Skip to content

feat: improve batching of postgres get queries - #6229

Merged
michaelkedar merged 2 commits into
google:masterfrom
michaelkedar:pg-improve
Oct 26, 2026
Merged

michaelkedar merged 2 commits into
google:masterfrom
michaelkedar:pg-improve

Conversation

@michaelkedar

Copy link
Copy Markdown
Member

Postgres testing on test can be a little slow for getting the vulnerability proto / modified dates.
Trying to improve Postgres speed by consolidating the batched gets into a single query, and reducing the batch size.

Still, can be improved a bit more later, by having a Postgres replica in the same region as the API, and avoid de-TOAST-ing the modified dates by having it inline.

Also passes NormalizeMatchNames to the Postgres store.

@michaelkedar
michaelkedar requested review from a team and jess-lowe October 26, 2026 02:43

@jess-lowe jess-lowe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't fully understand it but seems fine to me

@michaelkedar
michaelkedar merged commit 33bd906 into google:master Oct 26, 2026
23 checks passed
@michaelkedar
michaelkedar deleted the pg-improve branch October 26, 2026 03:05
Comment thread go/cmd/api/main.go
DB: pgPool,
BatchTimeout: batchTimeout,
BatchMaxElements: batchMaxElements,
NormalizeMatchNames: normalizeMatchNames,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be passing this into the api-devserver as well so we can test that locally?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh, yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants