{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3", "published": "2026-11-11T04:03:38Z", "publisher": "PostgresAI", "article": {"title": "UUIDv4 vs UUIDv7: what a random primary key costs in Postgres", "url": "https://postgres.ai/blog/20261105-uuidv4-vs-uuidv7", "date_published": "2026-11-05T12:00:00Z", "author": "Nikolay Samokhvalov", "publisher": "PostgresAI"}, "grade": "A", "axes": [{"axis": "Factual", "summary": "A \u00b7 0 wrong of 41 checked \u00b7 1 caveat"}, {"axis": "Applicable", "summary": "A \u00b7 0 checked \u00b7 partly assessed"}, {"axis": "Consistent", "summary": "A \u00b7 0 checked"}, {"axis": "Transparent", "summary": "A \u00b7 0 wrong of 19 checked \u00b7 0 caveats \u00b7 partly assessed"}, {"axis": "Safe", "summary": "A \u00b7 0 checked \u00b7 partly assessed"}], "findings": [{"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F1", "claim": "Any index on a UUIDv4 column behaves the same way\u2026", "title": "UUIDv4 foreign-key indexes need not behave like unique UUIDv4 primary keys.", "explanation": "Nonunique UUID indexes can deduplicate repeated keys into posting lists. A small, frequently referenced parent set can also concentrate inserts within a few leaves. The primary-key thresholds do not describe every foreign-key index.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/btree.sgml#L777-L785", "label": "REL_18_6 \u00b7 doc/src/sgml/btree.sgml:777-785"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/catalog/pg_amproc.dat#L282-L283", "label": "REL_18_6 \u00b7 src/include/catalog/pg_amproc.dat:282-283"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F2", "claim": "uuidv7() is monotonic within one backend but not across backends.", "title": "UUID generation and per-backend ordering match the source.", "explanation": "uuidv7() returns uuid and encodes Unix milliseconds plus a sub-millisecond fraction. Each backend advances its own timestamp state. gen_random_uuid() generates UUIDv4. The interval overload adjusts the timestamp without concealing its structure.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L564-L566", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:564-566"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L608-L732", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:608-732"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/adt/uuid.c#L591-L596", "label": "REL_18_0 \u00b7 src/backend/utils/adt/uuid.c:591-596"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L539-L544", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:539-544"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/catalog/pg_proc.dat#L9482-L9501", "label": "REL_18_6 \u00b7 src/include/catalog/pg_proc.dat:9482-9501"}]}, {"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F3", "claim": "\u2026it takes an ACCESS EXCLUSIVE lock\u2026", "title": "Changing the UUID default requires ACCESS EXCLUSIVE and preserves existing rows.", "explanation": "AT_ColumnDefault requires AccessExclusiveLock. Changing the default changes subsequent default evaluations without rewriting existing rows. Explicitly supplied IDs bypass the default. lock_timeout aborts a statement when an individual lock acquisition wait exceeds its setting.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/tablecmds.c#L4710-L4727", "label": "REL_18_6 \u00b7 src/backend/commands/tablecmds.c:4710-4727"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/alter_table.sgml#L223-L227", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/alter_table.sgml:223-227"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L10296-L10303", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:10296-10303"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_table.sgml#L886-L906", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/create_table.sgml:886-906"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/catalog/pg_proc.dat#L9482-L9501", "label": "REL_18_6 \u00b7 src/include/catalog/pg_proc.dat:9482-9501"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F4", "claim": "The \"split after new item\" rule that could pack a leaf in the middle skips single-column indexes\u2026", "title": "The mixed UUIDv4/UUIDv7 split explanation matches the single-column code path.", "explanation": "The interior split optimization rejects single-key indexes. Ordinary interior leaves use the 50:50 strategy. Sorted builds apply the leaf fillfactor threshold. Ascending UUIDv7 inserts inside an older UUIDv4 range can leave previously split left halves underfilled.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L219-L225", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:219-225"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsplitloc.c#L640-L644", "label": "REL_18_6 \u00b7 src/backend/access/nbtree/nbtsplitloc.c:640-644"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsplitloc.c#L329-L335", "label": "REL_18_6 \u00b7 src/backend/access/nbtree/nbtsplitloc.c:329-335"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsort.c#L662-L667", "label": "REL_18_6 \u00b7 src/backend/access/nbtree/nbtsort.c:662-667"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F5", "claim": "Partitioning on uuid_extract_timestamp(id) does not help a plain id = $1 lookup\u2026", "title": "Expression partitioning requires a matching expression restriction for pruning.", "explanation": "The pruning matcher compares a clause operand with the partition key expression. id = $1 matches direct id partitioning. It does not match uuid_extract_timestamp(id). An equality on that expression supplies the required restriction.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/partitioning/partprune.c#L1920-L1982", "label": "REL_18_6 \u00b7 src/backend/partitioning/partprune.c:1920-1982"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F6", "claim": "\u2026a primary key on a partitioned table must include the partition key\u2026", "title": "Partitioned primary keys must include partition columns and cannot use expression partition keys.", "explanation": "PostgreSQL rejects a partitioned unique constraint that omits a partitioning column. It also rejects these constraints when partition keys contain expressions. The stated restrictions on created_at and uuid_extract_timestamp(id) follow from those checks.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/indexcmds.c#L1032-L1038", "label": "REL_18_6 \u00b7 src/backend/commands/indexcmds.c:1032-1038"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/indexcmds.c#L1107-L1112", "label": "REL_18_6 \u00b7 src/backend/commands/indexcmds.c:1107-1112"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F7", "claim": "\u2026first change to a page after a checkpoint writes a full image\u2026", "explanation": "The WAL insertion code compares the page LSN with the checkpoint redo position. With full_page_writes enabled, ordinary first modifications require page images. Repeated changes amortize those images across inserts. More distinct existing leaves can require more images within a checkpoint interval.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/xloginsert.c#L618-L620", "label": "REL_18_6 \u00b7 src/backend/access/transam/xloginsert.c:618-620"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L3387-L3392", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:3387-3392"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F8", "claim": "Raise max_wal_size too, so checkpoints stay timed.", "title": "checkpoint_timeout and max_wal_size control different checkpoint triggers.", "explanation": "checkpoint_timeout sets the timed checkpoint interval. max_wal_size determines a WAL-distance checkpoint threshold. Increasing the timeout alone does not prevent WAL-driven checkpoints. Increasing checkpoint intervals can increase crash recovery work.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/xlog.c#L2187-L2197", "label": "REL_18_6 \u00b7 src/backend/access/transam/xlog.c:2187-2197"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc_tables.c#L2983-L2991", "label": "REL_18_6 \u00b7 src/backend/utils/misc/guc_tables.c:2983-2991"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F9", "claim": "\u2026bgwriter_lru_maxpages = 100 per bgwriter_delay = 200ms\u2026", "title": "The background-writer defaults and ceiling counter match PostgreSQL 18.6.", "explanation": "bgwriter_lru_maxpages defaults to 100 buffers per round. bgwriter_delay defaults to 200 ms. The cleaning scan increments maxwritten_clean when its write count reaches the limit. pg_stat_bgwriter exposes that counter.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc_tables.c#L3218-L3236", "label": "REL_18_6 \u00b7 src/backend/utils/misc/guc_tables.c:3218-3236"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc_tables.c#L3229-L3236", "label": "REL_18_6 \u00b7 src/backend/utils/misc/guc_tables.c:3229-3236"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/buffer/bufmgr.c#L3875-L3883", "label": "REL_18_6 \u00b7 src/backend/storage/buffer/bufmgr.c:3875-3883"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L1150-L1155", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:1150-1155"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F10", "claim": "\u2026watch pg_stat_io for writes by client backends in the normal context.", "title": "The foreground-write diagnostic uses valid shared-buffer and pg_stat_io mechanisms.", "explanation": "shared_buffers controls the shared buffer count. A backend can flush a dirty victim before reusing its buffer. pg_stat_io exposes the query's backend_type, object, context, reads, writes, and evictions columns. Those statistics aggregate activity across relations.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc_tables.c#L2379-L2387", "label": "REL_18_6 \u00b7 src/backend/utils/misc/guc_tables.c:2379-2387"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/buffer/bufmgr.c#L2420-L2483", "label": "REL_18_6 \u00b7 src/backend/storage/buffer/bufmgr.c:2420-2483"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L1171-L1193", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:1171-1193"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F11", "claim": "\u2026pg_stat_wal\u2026", "title": "pg_stat_wal provides the stated class of WAL measurements.", "explanation": "pg_stat_wal exposes WAL records, full-page images, WAL bytes, WAL-buffer-full events, and the statistics reset timestamp. The view is appropriate for the named WAL sampling purpose.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L1195-L1202", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:1195-1202"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F12", "claim": "With synchronous_commit = on , each transaction waits for its WAL flush\u2026", "title": "synchronous_commit waits for WAL flush in the demonstrated workload.", "explanation": "The commit path calls XLogFlush for committed WAL-writing transactions when synchronous_commit exceeds off. This supports the article's flush explanation. The measured grouping and throughput effects require the experiment's counters.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/xact.c#L1498-L1503", "label": "REL_18_6 \u00b7 src/backend/access/transam/xact.c:1498-1503"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F13", "claim": "With checksums, hint-bit changes also write full-page images after a checkpoint.", "title": "PostgreSQL 18 enables checksums by default and protects qualifying hint-bit changes with page images.", "explanation": "initdb defaults data_checksums to true in PostgreSQL 18. Checksums activate XLogHintBitIsNeeded(). The hint-bit dirtying path records a page image when the hint update is the first post-checkpoint change requiring protection.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/bin/initdb/initdb.c#L167-L167", "label": "REL_18_6 \u00b7 src/bin/initdb/initdb.c:167-167"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/bin/initdb/initdb.c#L163-L169", "label": "REL_18_0 \u00b7 src/bin/initdb/initdb.c:163-169"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/access/xlog.h#L120-L120", "label": "REL_18_6 \u00b7 src/include/access/xlog.h:120-120"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/buffer/bufmgr.c#L5490-L5547", "label": "REL_18_6 \u00b7 src/backend/storage/buffer/bufmgr.c:5490-5547"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F14", "claim": "An index entry is an 8-byte tuple header plus the key\u2026", "title": "The leaf-entry layout and default B-tree fillfactor support the size calculation.", "explanation": "The tuple header contains a heap TID and t_info. PostgreSQL aligns tuple storage and adds a line pointer. On the tested build, this gives 28 B per UUID entry and 20 B per bigint entry. B-tree fillfactor defaults to 90.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/access/itup.h#L25-L52", "label": "REL_18_6 \u00b7 src/include/access/itup.h:25-52"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/storage/itemid.h#L23-L45", "label": "REL_18_6 \u00b7 src/include/storage/itemid.h:23-45"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/common/indextuple.c#L150-L166", "label": "REL_18_6 \u00b7 src/backend/access/common/indextuple.c:150-166"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/access/nbtree.h#L201-L201", "label": "REL_18_6 \u00b7 src/include/access/nbtree.h:201-201"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/utils/uuid.h#L18-L18", "label": "REL_18_6 \u00b7 src/include/utils/uuid.h:18-18"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F15", "claim": "Only a rebuild, such as REINDEX CONCURRENTLY , recovers that space.", "title": "VACUUM does not compact partly occupied B-tree leaves.", "explanation": "B-tree page deletion begins with an empty leaf. VACUUM does not merge partly occupied leaves. A rebuild repacks surviving entries. This supports the rebuild recommendation under the article's stated random-delete and ascending-refill conditions.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsort.c#L662-L667", "label": "REL_18_6 \u00b7 src/backend/access/nbtree/nbtsort.c:662-667"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/README#L235-L241", "label": "REL_18_6 \u00b7 src/backend/access/nbtree/README:235-241"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F16", "claim": "\u2026id uuid default gen_random_uuid() primary key\u2026", "title": "The table definitions use supported built-in defaults and column declarations.", "explanation": "The UUID defaults return uuid. The bigint identity declaration supplies sequence values. clock_timestamp() supplies the shown timestamp default. The INSERT can omit both defaulted columns. The secondary indexes reference columns declared in the table.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L539-L544", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:539-544"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_table.sgml#L886-L906", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/create_table.sgml:886-906"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_table.sgml#L941-L954", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/create_table.sgml:941-954"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L11246-L11255", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:11246-11255"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/catalog/pg_proc.dat#L9482-L9501", "label": "REL_18_6 \u00b7 src/include/catalog/pg_proc.dat:9482-9501"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F17", "claim": "\u2026\\set uid random_zipfian(1, 10000000, 1.1)\u2026", "title": "The pgbench Zipfian expression and payload expression are supported.", "explanation": "pgbench accepts Zipfian parameters from 1.001 through 1000, including 1.1. The SQL hashes the text representation of random() and repeats the resulting hexadecimal MD5 text three times. The statement supplies the required user_id and payload values.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/pgbench.sgml#L2188-L2198", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/pgbench.sgml:2188-2198"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L3234-L3250", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:3234-3250"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L3631-L3642", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:3631-3642"}]}, {"anchor": "F18", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F18", "claim": "\u2026In Postgres 17, uuid_extract_timestamp() returns NULL for UUIDv7\u2026", "title": "The PostgreSQL 17 timestamp limitation and UUIDv7 SQL workaround are supported.", "explanation": "The PostgreSQL 17 native extractor handles version 1 and returns NULL otherwise. PostgreSQL 18 adds version 7. The SQL workaround converts the first 48 bits from milliseconds to Unix seconds. It does not validate the UUID version.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/backend/utils/adt/uuid.c#L445-L471", "label": "REL_17_0 \u00b7 src/backend/utils/adt/uuid.c:445-471"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L745-L810", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:745-810"}, {"url": "https://github.com/postgres/postgres/blob/fbb530a3dff569222bea7098ad4de3d8bde97740/src/backend/utils/adt/varbit.c#L1666-L1697", "label": "REL_17_7 \u00b7 src/backend/utils/adt/varbit.c:1666-1697"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L10144-L10154", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:10144-10154"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L14425-L14556", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:14425-14556"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/func.sgml#L14517-L14525", "label": "REL_18_0 \u00b7 doc/src/sgml/func.sgml:14517-14525"}, {"url": "https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/doc/src/sgml/func.sgml#L14186-L14195", "label": "REL_17_0 \u00b7 doc/src/sgml/func.sgml:14186-14195"}]}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F19", "claim": "\u2026put the Unix time in milliseconds into the first 48 bits. Fill the rest with zeros.", "title": "The UUID time-bound construction matches UUID byte ordering.", "explanation": "UUID comparison uses memcmp. UUIDv7 stores Unix milliseconds in its leading 48 bits. A zero suffix sorts below valid UUIDv7 values with that prefix. The stated 2026-10-01 boundary has hexadecimal prefix 01a0f4c2c400.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L608-L732", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:608-732"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L219-L225", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:219-225"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L10144-L10154", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:10144-10154"}]}, {"anchor": "F20", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F20", "claim": "\u2026Aurora counts write I/Os in 4 KiB units.", "title": "AWS supports the stated Aurora write-request units and batching condition.", "explanation": "AWS describes Aurora writes in 4 KB units when possible. It describes batching small log records when the writer has several available together. These statements support the article's batching assumptions, subject to its stated model limits.", "verdict": "Accurate", "sources": [{"url": "https://aws.amazon.com/blogs/database/planning-i-o-in-amazon-aurora/", "label": "https://aws.amazon.com/blogs/database/planning-i-o-in-amazon-aurora/"}, {"url": "https://aws.amazon.com/blogs/database/planning-i-o-in-amazon-aurora/", "label": "https://aws.amazon.com/blogs/database/planning-i-o-in-amazon-aurora/"}]}, {"anchor": "F21", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F21", "claim": "In Postgres, an insert-only table appends rows to the heap whatever the key\u2026", "title": "Heap insertion does not cluster rows by primary-key value.", "explanation": "RelationGetBufferForTuple selects heap space using available page space and the free-space map. It extends the relation when necessary. The primary-key value does not impose heap ordering. Random-key placement occurs in the corresponding B-tree.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/hio.c#L437-L480", "label": "REL_18_6 \u00b7 src/backend/access/heap/hio.c:437-480"}]}, {"anchor": "F22", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F22", "claim": "Order by created_at on UUIDv4 tables.", "title": "UUIDv4 ordering does not express row recency.", "explanation": "UUID comparison orders the stored bytes. UUIDv4 fills those bytes randomly apart from version and variant bits. Descending UUIDv4 order selects large random identifiers. Ordering by the shown created_at column expresses the requested creation-time ordering.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L539-L544", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:539-544"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/uuid.c#L219-L225", "label": "REL_18_6 \u00b7 src/backend/utils/adt/uuid.c:219-225"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsplitloc.c#L329-L335", "label": "REL_18_6 \u00b7 src/backend/access/nbtree/nbtsplitloc.c:329-335"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L11246-L11255", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:11246-11255"}]}, {"anchor": "F23", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F23", "claim": "\u2026wal_compression = off (lz4 tested separately)\u2026", "title": "wal_compression compresses page images and conditionally supports lz4.", "explanation": "wal_compression compresses full-page images in WAL. PostgreSQL decompresses those images during replay. lz4 requires a build configured with lz4 support. The setting does not compress every logical WAL record.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L3453-L3486", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:3453-3486"}]}, {"anchor": "F24", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F24", "claim": "The startup process replays WAL in one process\u2026", "title": "The physical recovery loop applies WAL records serially.", "explanation": "The recovery loop calls ApplyWalRecord for the current record before fetching the next record. This supports the article's single-process replay explanation. The replay performance differences require the standby measurements.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/xlogrecovery.c#L1842-L1863", "label": "REL_18_6 \u00b7 src/backend/access/transam/xlogrecovery.c:1842-1863"}]}, {"anchor": "F25", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F25", "claim": "\u2026Postgres 18 ships uuidv7()\u2026", "title": "PostgreSQL 18 documents uuidv7()", "explanation": "PostgreSQL 18 lists uuidv7() as a built-in UUIDv7 generator. The documented signature accepts an optional shift interval.", "verdict": "Accurate", "sources": [{"url": "https://www.postgresql.org/docs/18/functions-uuid.html", "label": "https://www.postgresql.org/docs/18/functions-uuid.html"}]}, {"anchor": "F26", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F26", "claim": "\u2026Postgres 18 adds a sub-millisecond fraction\u2026", "title": "PostgreSQL 18 documents a sub-millisecond UUIDv7 component", "explanation": "PostgreSQL 18 documents millisecond time, a sub-millisecond timestamp component, and random data in uuidv7().", "verdict": "Accurate", "sources": [{"url": "https://www.postgresql.org/docs/18/functions-uuid.html", "label": "https://www.postgresql.org/docs/18/functions-uuid.html"}]}, {"anchor": "F27", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F27", "claim": "\u2026uuid_extract_timestamp() returns NULL for them\u2026", "title": "UUIDv4 timestamp extraction returns null in PostgreSQL 18", "explanation": "PostgreSQL 18 documents timestamp extraction for UUID versions 1 and 7. Other versions, including UUIDv4, return null.", "verdict": "Accurate", "sources": [{"url": "https://www.postgresql.org/docs/18/functions-uuid.html", "label": "https://www.postgresql.org/docs/18/functions-uuid.html"}]}, {"anchor": "F28", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F28", "claim": "\u2026Postgres 18 also adds uuidv4() , another name for gen_random_uuid()\u2026", "title": "PostgreSQL 18 documents both UUIDv4 generator names", "explanation": "PostgreSQL 18 documents gen_random_uuid() and uuidv4() together as UUIDv4 generators.", "verdict": "Accurate", "sources": [{"url": "https://www.postgresql.org/docs/18/functions-uuid.html", "label": "https://www.postgresql.org/docs/18/functions-uuid.html"}]}, {"anchor": "F29", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F29", "claim": "\u2026UUIDv4 took 20:40 and UUIDv7 1:46\u2026", "title": "The cited bulk-load timings round correctly", "explanation": "The cited 50-million-row load reports 20:39.840 for UUIDv4 and 01:46.343 for UUIDv7. The article rounds those to 20:40 and 1:46.", "verdict": "Accurate", "sources": [{"url": "https://www.credativ.de/en/blog/postgresql-en/a-deeper-look-at-old-uuidv4-vs-new-uuidv7-in-postgresql-18/", "label": "https://www.credativ.de/en/blog/postgresql-en/a-deeper-look-at-old-uuidv4-vs-new-uuidv7-in-postgresql-18/"}]}, {"anchor": "F30", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F30", "claim": "\u2026random keys ran at less than 30%\u2026", "title": "The earlier benchmark reports throughput below 30%", "explanation": "The cited benchmark reports random UUID throughput below 30% for data exceeding shared buffers but fitting RAM. It says ordered generators largely maintained throughput.", "verdict": "Accurate", "sources": [{"url": "https://www.enterprisedb.com/blog/sequential-uuid-generators", "label": "https://www.enterprisedb.com/blog/sequential-uuid-generators"}]}, {"anchor": "F31", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F31", "claim": "It does not name the database or say that the key was the primary key.", "title": "The cited payment benchmark omits its database and primary-key role", "explanation": "The cited anecdote reports 50% lower INSERT duration after replacing UUIDv4 idempotency keys with ULIDs. It identifies neither the database nor a primary-key role.", "verdict": "Accurate", "sources": [{"url": "https://shopify.engineering/building-resilient-payment-systems", "label": "https://shopify.engineering/building-resilient-payment-systems"}]}, {"anchor": "F32", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F32", "claim": "Aurora I/O-Optimized has no per-I/O charge\u2026", "title": "Aurora I/O-Optimized includes read and write I/O charges", "explanation": "The Aurora billing FAQ includes read and write I/O at no additional charge under I/O-Optimized.", "verdict": "Accurate", "sources": [{"url": "https://docs.aws.amazon.com/rds/latest/auroraextendedcontent/aurora-faq-billing.html", "label": "https://docs.aws.amazon.com/rds/latest/auroraextendedcontent/aurora-faq-billing.html"}]}, {"anchor": "F33", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F33", "claim": "The first 48 bits are a millisecond timestamp\u2026", "title": "UUIDv7 starts with a 48-bit millisecond timestamp", "explanation": "RFC 9562 section 5.7 assigns the first 48 bits to a big-endian Unix timestamp in milliseconds.", "verdict": "Accurate", "sources": [{"url": "https://www.rfc-editor.org/rfc/rfc9562", "label": "https://www.rfc-editor.org/rfc/rfc9562"}]}, {"anchor": "F34", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F34", "claim": "\u2026UUIDv4: 122 random bits\u2026", "title": "UUIDv4 has 122 random bits", "explanation": "RFC 9562 specifies 122 random bits for UUIDv4. The remaining 6 bits encode its version and variant.", "verdict": "Accurate", "sources": [{"url": "https://www.rfc-editor.org/rfc/rfc9562", "label": "https://www.rfc-editor.org/rfc/rfc9562"}]}, {"anchor": "F35", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F35", "claim": "\u2026an int8 index is 29% smaller than a UUIDv7 index.", "title": "The reported index-size percentages agree", "explanation": "The int8 index uses 28.8% fewer bytes than UUIDv7 (derived: 1 \u2212 2,146 / 3,012). UUIDv4 uses 32.7% more bytes than UUIDv7 (derived: 3,996 / 3,012 \u2212 1). Both percentages round as stated.", "verdict": "Accurate", "sources": [{"url": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc", "label": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc"}]}, {"anchor": "F36", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F36", "claim": "\u2026Rows = size \u00f7 bytes per row at 100M rows\u2026", "title": "All 12 size-planning cells round correctly", "explanation": "The table consistently uses binary capacities and 41.8, 31.5, and 22.5 bytes per row. One GiB holds approximately 25.7 million UUIDv4 entries (derived: 1,073,741,824 bytes / 41.8 bytes per row).", "verdict": "Accurate", "sources": [{"url": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc", "label": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc"}]}, {"anchor": "F37", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F37", "claim": "\u2026UUIDv4 wrote 1.5 to 1.9 times the reference key's WAL per row on the same server.", "title": "The WAL range matches the stated measurement window", "explanation": "The study reports UUIDv4/reference WAL ratios of 1.53\u20131.85 over 90 million to 100 million rows. The article rounds that range to 1.5\u20131.9.", "verdict": "Accurate", "sources": [{"url": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc", "label": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc"}]}, {"anchor": "F38", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F38", "claim": "The index ended up 69% full, with 45% of leaves out of order.", "title": "The clock-skew figures match the study", "explanation": "The study reports 69% leaf density and 45% physical leaf disorder for skewed UUIDv7 clients. Clean UUIDv7 insertion produced 90% density and no physical leaf disorder.", "verdict": "Accurate", "sources": [{"url": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc", "label": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc"}]}, {"anchor": "F39", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F39", "claim": "Deleting a random 30% and refilling left the primary key 1.30 times larger.", "title": "The random-delete growth ratio matches the study", "explanation": "The study reports a 1.300 primary-key size ratio after random deletion and refill. Its oldest-first deletion test reports 1.000. The article preserves both comparisons.", "verdict": "Accurate", "sources": [{"url": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc", "label": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc"}]}, {"anchor": "F40", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F40", "claim": "\u2026int8 plus a uuidv7() unique column cost 35% more index bytes per row than UUIDv7 alone\u2026", "title": "The two-key 35% increase uses the correct population", "explanation": "The study reports 35% more total index bytes per row for int8 plus a unique UUIDv7 column. The comparison includes the unchanged secondary indexes.", "verdict": "Accurate", "sources": [{"url": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc", "label": "https://console.postgres.ai/shared/brief/9fffe2da-00c1-470b-a79d-a210ae2306bc"}]}, {"anchor": "F41", "url": "https://pgtrue.postgres.ai/shared/brief/01a1c8ee-d00d-7834-ac6b-8a93c74e09b3#F41", "claim": "\u2026UUIDv4 took 20:40 and UUIDv7 1:46.", "title": "The cited bulk-load timings round correctly", "explanation": "The original timings are 20 minutes 39.840 seconds for UUIDv4 and 1 minute 46.343 seconds for UUIDv7. They round to 20:40 and 1:46.", "verdict": "Accurate", "sources": [{"url": "https://www.credativ.de/en/blog/postgresql-en/a-deeper-look-at-old-uuidv4-vs-new-uuidv7-in-postgresql-18/", "label": "https://www.credativ.de/en/blog/postgresql-en/a-deeper-look-at-old-uuidv4-vs-new-uuidv7-in-postgresql-18/"}]}]}