Re: why hash on the primary key? - Mailing list pgsql-general

From Robert Haas
Subject Re: why hash on the primary key?
Date
Msg-id 603c8f070811290531q73e45615u567ffd7ddf79f310@mail.gmail.com
Whole thread Raw
In response to Re: why hash on the primary key?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: why hash on the primary key?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> What's strange about it?  A probe into an in-memory hashtable is a lot
> cheaper than a probe into an index, so this type of plan makes plenty
> of sense if the hashtable will fit in RAM and there are going to be a
> lot of probes.  (Where "a lot" means "enough to amortize the cost of
> building the hashtable", of course.)

Hmm...  it didn't occur to me that the index probe itself might be
more expensive than a hash probe.  Is that due to concurrency control,
or are you talking about the need to possibly read index pages in from
disk?

>> Experimentation shows this is actually about 25% faster.
>
> Well, that just says your cost parameters need a bit of adjustment
> if you'd like the planner to get the crossover point exactly right.

Any sense of which ones might be worth fiddling with?

...Robert

pgsql-general by date:

Previous
From: "Robert Haas"
Date:
Subject: Re: why hash on the primary key?
Next
From: Tom Lane
Date:
Subject: Re: why hash on the primary key?