Skip to content

Faster alias insert#1934

Draft
crozzy wants to merge 3 commits into
quay:mainfrom
crozzy:faster-alias-insert
Draft

Faster alias insert#1934
crozzy wants to merge 3 commits into
quay:mainfrom
crozzy:faster-alias-insert

Conversation

@crozzy

@crozzy crozzy commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

hdonnay added 2 commits June 29, 2026 16:03
Adds a test that trips an Alias insertion deadlock.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I4f7f613f17e47c7cbcff82fbbb7674a06a6a6964
This fixes a transaction conflict where concurrent updaters could
attempt to insert the same alias namespaces and cause the entire update
to abort.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I4f7f613f17e47c7cbcff82fbbb7674a06a6a6964
@crozzy crozzy force-pushed the faster-alias-insert branch from 02f985f to 11ccd1a Compare June 29, 2026 23:15
Replace the per-vulnerability insertVulnerabilityAliases and
insertSelfAlias batch queries — each of which did a hash-lookup
subquery against the vuln table — with two single bulk INSERT
statements that use unnest() + JOIN to link all vulnerabilities
to their aliases and self-references in one pass.

The flattened (hash_kind, hash, alias_space, alias_name) arrays
accumulated during the vuln iteration are comparable in size to
the arrays already built by the insertAliases pre-pass, so memory
usage does not grow significantly relative to what was already held.

For VEX with a 2-year lookback (~1.1M vulns), this reduces the
alias-linking phase from timing out at 30 minutes to ~43 seconds.

Signed-off-by: crozzy <joseph.crosland@gmail.com>
@crozzy crozzy force-pushed the faster-alias-insert branch from 11ccd1a to b7e27ee Compare June 30, 2026 15:53
@crozzy crozzy requested a review from jvdm June 30, 2026 16:50
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