sequential_uuids
sequential_uuids
sequential_uuids : generator of sequential UUIDs
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4570 | sequential_uuids
|
sequential_uuids
|
1.0.3 |
FUNC
|
MIT
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d-r
|
No
|
Yes
|
No
|
Yes
|
yes
|
no
|
| Relationships | |
|---|---|
| See Also | pg_idkit
pg_uuidv7
pgx_ulid
uuid-ossp
pg_hashids
permuteseq
|
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | MIXED
|
1.0.3 |
18
17
16
15
14
|
sequential_uuids |
- |
| RPM | PGDG
|
1.0.3 |
18
17
16
15
14
|
sequential_uuids_$v |
- |
| DEB | PIGSTY
|
1.0.3 |
18
17
16
15
14
|
postgresql-$v-sequential-uuids |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
el8.aarch64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
el9.x86_64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
el9.aarch64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
el10.x86_64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
el10.aarch64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
d12.x86_64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
d12.aarch64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
d13.x86_64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
d13.aarch64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
u22.x86_64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
u22.aarch64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
u24.x86_64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
u24.aarch64
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
PIGSTY 1.0.3
|
Source
pig build pkg sequential_uuids; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install sequential_uuids; # install via package name, for the active PG version
pig install sequential_uuids -v 18; # install for PG 18
pig install sequential_uuids -v 17; # install for PG 17
pig install sequential_uuids -v 16; # install for PG 16
pig install sequential_uuids -v 15; # install for PG 15
pig install sequential_uuids -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION sequential_uuids;Usage
sequential_uuids: sequential UUID generators for better index locality
Generates UUIDs with sequential patterns to reduce random I/O in indexes while maintaining sufficient randomness to avoid collisions.
CREATE EXTENSION sequential_uuids;Functions
| Function | Description |
|---|---|
uuid_sequence_nextval(sequence regclass, block_size int DEFAULT 65536, block_count int DEFAULT 65536) |
Generate a sequential UUID based on a sequence |
uuid_time_nextval(interval_length int DEFAULT 60, interval_count int DEFAULT 65536) |
Generate a sequential UUID based on current timestamp |
Examples
CREATE SEQUENCE my_seq;
-- Sequence-based UUID generation
SELECT uuid_sequence_nextval('my_seq'::regclass);
-- Time-based UUID generation (wraps around every ~45 days with defaults)
SELECT uuid_time_nextval();
-- Use as default for a column
CREATE TABLE orders (
id uuid DEFAULT uuid_time_nextval() PRIMARY KEY,
data text
);
-- Custom block size and count
SELECT uuid_sequence_nextval('my_seq', 256, 65536);
SELECT uuid_time_nextval(120, 32768);Last updated on