Re: Sequential UUID Generation

2018-11-27 Thread Tomas Vondra
On 11/19/18 2:08 PM, Uday Bhaskar V wrote: I tried below function as which can be used as default to column. But every time we need to created 2 sequences, 1st one takes care of the first 8 bytes and 2nd takes care of the 2nd part of the UUID. I have not tested index and space utilization. I ha

Re: Sequential UUID Generation

2018-11-19 Thread Uday Bhaskar V
I tried below function as which can be used as default to column. But every time we need to created 2 sequences, 1st one takes care of the first 8 bytes and 2nd takes care of the 2nd part of the UUID. I have not tested index and space utilization. I have to examine this. This might not be completel

Re: Sequential UUID Generation

2018-10-30 Thread Sehrope Sarkuni
I came across a project for time based UUID ("tuid") a little while back: https://github.com/tanglebones/pg_tuid I haven't used in production but skimmed through the code a bit out of technical curiosity. It handles some of the expected edge cases for backwards clock drift and concurrent generatio

Re: Sequential UUID Generation

2018-10-30 Thread Adam Brusselback
I would be very interested in a extension which generated sequential uuids. My entire db is key'd with uuids, and I have measured some index bloat related specifically to random uuid generation. Thanks for bringing this up.

Re: Sequential UUID Generation

2018-10-30 Thread Uday Bhaskar V
Thanks Tomas! I will try. Regards, Uday On Tue, Oct 30, 2018 at 6:43 PM Tomas Vondra wrote: > I don't think PostgreSQL has anything like that at the moment. It would > not be difficult to tweak the UUID generator to generate sequential (or > monotonic) values, the tricky part seems to be durabi

Re: Sequential UUID Generation

2018-10-30 Thread Tomas Vondra
I don't think PostgreSQL has anything like that at the moment. It would not be difficult to tweak the UUID generator to generate sequential (or monotonic) values, the tricky part seems to be durability requirements. One idea would be to simply store the value in (shared) memory, but that would mea