Re: Sequence Access Methods, round two
Andrei Lepikhov <lepihov@gmail.com>
From: Andrei Lepikhov <lepihov@gmail.com>
To: Michael Paquier <michael@paquier.xyz>,
Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Xuneng Zhou <xunengzhou@gmail.com>, Chao Li <li.evan.chao@gmail.com>,
Peter Eisentraut <peter@eisentraut.org>,
Kirill Reshke <reshkekirill@gmail.com>, Peter Smith <smithpb2250@gmail.com>
Date: 2026-05-15T09:04:37Z
Lists: pgsql-hackers
Attachments
- v29-0001-Integrate-addition-of-attributes-for-sequences-w.patch (text/plain)
- v29-0002-Refactor-code-for-in-core-local-sequences.patch (text/plain)
- v29-0003-Sequence-access-methods-backend-support.patch (text/plain)
- v29-0004-Sequence-access-methods-dump-restore-support.patch (text/plain)
- v29-0005-Sequence-access-methods-core-documentation.patch (text/plain)
- v29-0006-Refactor-logic-for-page-manipulations-of-sequenc.patch (text/plain)
- v29-0007-snowflake-Add-sequence-AM-based-on-it.patch (text/plain)
On 07/01/2026 06:32, Michael Paquier wrote: > For now, I am sending a rebased v28. This stuff needed a refresh. Here is a rebased version of the patch set. It is generally looks quite elegant. Of course, an int64 value seems a little restrictive, but in practice, with four different algorithms on board, I don't need a value larger than 64 bits at this moment. Notes on the snowflake sequence (0007): 1. The gettimeofday() might be called out of the loop before the exclusive lock is acquired. 2. At least in my experience, gettimeofday does not always return monotonically increased values. So, it makes sense to save the used value inside the 'seq' structure and, if gettimeofday returned an earlier value, just increase this cached value a little. 3. Sleep call under the lock. It might not be so inevitable, and call it only when the time value stays the same. -- regards, Andrei Lepikhov, pgEdge