Skip to content

postgres: do callback hell instead of giant slices - #2002

Draft
hdonnay wants to merge 7 commits into
quay:mainfrom
hdonnay:hack/pgx-callback-hell
Draft

postgres: do callback hell instead of giant slices#2002
hdonnay wants to merge 7 commits into
quay:mainfrom
hdonnay:hack/pgx-callback-hell

Conversation

@hdonnay

@hdonnay hdonnay commented Aug 28, 2026

Copy link
Copy Markdown
Member

No description provided.

@hdonnay
hdonnay force-pushed the hack/pgx-callback-hell branch 2 times, most recently from b993b9e to 6dca8a9 Compare August 28, 2026 15:24
Exercise UpdateVulnerabilities with enough alias-carrying
vulnerabilities to cross batch-flush boundaries and verify the link
tables directly. The benchmark reports peak live heap alongside the
usual metrics, since allocation lifetime is invisible to B/op.

Signed-off-by: Brad Lugo <blugo@redhat.com>
Insert and link aliases every 500 vulnerabilities instead of
accumulating bookkeeping for the whole run, halving peak heap for
large updates (82MB to 40MB at 50k vulnerabilities). The out-of-band
alias inserts now happen mid-run, so a failed update can leave alias
rows committed; they are unreachable until a later successful run
links them.

Signed-off-by: Brad Lugo <blugo@redhat.com>
The chunked link statements are INSERT..SELECTs that must see alias
rows committed by concurrent updaters after the transaction began, so
pin read committed instead of inheriting
default_transaction_isolation.

Signed-off-by: Brad Lugo <blugo@redhat.com>
Chunking runs the link statements often enough to cross the
prepared-statement threshold, where the generic plan built for
unnest's default row estimate gets chosen and is disastrous for the
actual array sizes. Executing unprepared keeps per-execution
planning.

Signed-off-by: Brad Lugo <blugo@redhat.com>
@hdonnay
hdonnay force-pushed the hack/pgx-callback-hell branch from 6dca8a9 to a4780dd Compare August 28, 2026 19:53
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I85a31f5796751b32e698b7b0108461146a6a6964
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I7b0aef57f26107254a546add7442b9556a6a6964
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: If851629a80d299ba5730d2b7601bbe246a6a6964
@hdonnay
hdonnay force-pushed the hack/pgx-callback-hell branch from a4780dd to e74cee1 Compare August 28, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants