From: | Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> |
---|---|
To: | David Rowley <dgrowleyml(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: init_sequence spill to hash table |
Date: | 2013-11-14 14:03:41 |
Message-ID: | 5284D83D.8030603@vmware.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 14.11.2013 14:38, David Rowley wrote:
> I've just completed some more benchmarking of this. I didn't try dropping
> the threshold down to 2 or 0 but I did tests at the cut over point and
> really don't see much difference in performance between the list at 32 and
> the hashtable at 33 sequences. The hash table version excels in the 16000
> sequence test in comparison to the unpatched version.
>
> Times are in milliseconds of the time it took to call currval() 100000
> times for 1 sequence.
> Patched Unpatched increased by 1 in cache 1856.452 1844.11 -1% 32 in
> cache 1841.84 1802.433 -2% 33 in cache 1861.558 not tested N/A 16000 in
> cache 1963.711 10329.22 426%
If I understand those results correctly, the best case scenario with the
current code takes about 1800 ms. There's practically no difference with
N <= 32, where N is the number of sequences touched. The hash table
method also takes about 1800 ms when N=33. The performance of the hash
table is O(1), so presumably we can extrapolate from that that it's the
same for any N.
I think that means that we should just completely replace the list with
the hash table. The difference with a small N is lost in noise, so
there's no point in keeping the list as a fast path for small N. That'll
make the patch somewhat simpler.
- Heikki
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2013-11-14 14:12:10 | Re: init_sequence spill to hash table |
Previous Message | Claudio Freire | 2013-11-14 13:53:36 | Re: Optimize kernel readahead using buffer access strategy |