Re: Single client performance on trivial SELECTs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Single client performance on trivial SELECTs
Date
Msg-id 19517.1302811370@sss.pgh.pa.us
Whole thread Raw
In response to Re: Single client performance on trivial SELECTs  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Single client performance on trivial SELECTs  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> There's one very low-hanging fruit here, though. I profiled the pgbench 
> case, with -M prepared, and found that like in Greg Smith's profile, 
> hash_seq_search pops up quite high in the list. Those calls are coming 
> from LockReleaseAll(), where we scan the local lock hash to find all 
> locks held. We specify the initial size of the local lock hash table as 
> 128, which is unnecessarily large for small queries like this. Reducing 
> it to 8 slashed the time spent in hash_seq_search().

> I think we should make that hash table smaller. It won't buy much, 
> somewhere between 1-5 % in this test case, but it's very easy to do and 
> I don't see much downside, it's a local hash table so it will grow as 
> needed.

8 sounds awfully small.  Can you even get as far as preparing the
statements you intend to use without causing that to grow?

I agree that 128 may be larger than necessary, but I don't think we
should pessimize normal usage to gain a small fraction on trivial
queries.  I'd be happier with something like 16 or 32.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Single client performance on trivial SELECTs
Next
From: Andres Freund
Date:
Subject: Re: Single client performance on trivial SELECTs