From: | David Rowley <dgrowleyml(at)gmail(dot)com> |
---|---|
To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | init_sequence spill to hash table |
Date: | 2013-11-13 09:55:43 |
Message-ID: | CAApHDvpAczv3XjmRsa9HJ4YEVSKiqX0QTaQew7-DoFKsuzeO5Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Here http://www.postgresql.org/message-id/24278.1352922571@sss.pgh.pa.us there
was some talk about init_sequence being a bottleneck when many sequences
are used in a single backend.
The attached I think implements what was talked about in the above link
which for me seems to double the speed of a currval() loop over 30000
sequences. It goes from about 7 seconds to 3.5 on my laptop.
I thought I would post the patch early to see if this is actually wanted
before I do too much more work on it.
My implementation maintains using the linear list for sequences up to a
defined threshold (currently 32) then it moves everything over to a
hashtable and free's off the list.
A more complete solution would contain regression tests to exercise the
hash table code.
I know there is a desire to move sequences over to a single table still,
but I see this as a separate patch and storing current values in a hash
table for each backend should still be a win even if/when the single table
stuff gets implemented.
Regards
David Rowley
Attachment | Content-Type | Size |
---|---|---|
sequence.sql | text/plain | 1.1 KB |
hashtab_seq_v0.1.patch | application/octet-stream | 6.3 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Haribabu kommi | 2013-11-13 10:35:51 | Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review]) |
Previous Message | Colin 't Hart | 2013-11-13 09:40:31 | [PATCH] Sort contents entries in reference documentation |