primary key

Started by Sandeep Joshiover 25 years ago2 messagesgeneral
Jump to latest
#1Sandeep Joshi
sjoshi@Zambeel.com

Hi,
When we specify "primary key" while creating a table, what kind of
index is created?
btree/hash?

Sandeep

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sandeep Joshi (#1)
Re: primary key

Sandeep Joshi <sjoshi@Zambeel.com> writes:

When we specify "primary key" while creating a table, what kind of
index is created?

btree.

btree is the default index type in all cases in Postgres. It's
considerably better tested than the other types, as well as better-
performing under concurrent access. That's not necessarily an
inherent property of btrees in general, but I think it's a safe
comment about the code that actually exists in Postgres...

regards, tom lane