Repository navigation
ci: check query plans of the PostgreSQL database tests - #66854
Open
juliusknorr wants to merge 3 commits into
Open
juliusknorr wants to merge 3 commits into
juliusknorr wants to merge 3 commits into
Conversation
Emails are stored lowercase, so a case-insensitive search can lowercase the value and compare the indexed column directly instead of LOWER(indexed). Case-insensitive searches on other indexed keys log a warning, as they cannot use the index. Signed-off-by: Julius Knorr <jus@bitgrid.net> Assisted-by: ClaudeCode:claude-opus-5-5
Records each distinct query of the test run with its caller and explains it afterwards with sequential scans disabled. Fails on new queries that filter a large table in a way no index can serve, such as a function around an indexed column. Signed-off-by: Julius Knorr <jus@bitgrid.net> Assisted-by: ClaudeCode:claude-opus-5-5
Also ignores queries issued from PHPUnit's base TestCase, e.g. in setUp. Signed-off-by: Julius Knorr <jus@bitgrid.net> Assisted-by: ClaudeCode:claude-opus-5-5
juliusknorr
marked this pull request as ready for review
November 20, 2026 11:00
juliusknorr
requested review from
leftybournes and
salmart-dev
and removed request for
a team
November 20, 2026 11:00
6 tasks done
Contributor
|
Possible performance regression detected Show Output |
Member
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since v33,
getByEmail()searchesLOWER("indexed") = ?, so theoc_preferencesindex only narrows down to all email rows. CI didn't notice: results and query count stayed the same.UserConfiglowercases the search value forsettings/emailand comparesindexeddirectly. A case-insensitive search on other indexed keys logs a warningEXPLAINon them with seq scans disabled. New queries that filter a large table in a way no index can serve (a remaining seq scan, or a function around an indexed column) fail the job. Known ones are listed intests/data/query-plan-baseline.jsonWithout the fix, the check reports:
Limits: the check only sees queries that DB tests run, and it doesn't flag an
ORwith a non-indexed branch.On a full
test:dbrun (6372 tests, 3044 distinct queries) the check flags one existing query:FilesByTypein OpenMetrics filtersoc_filecacheonpath LIKE 'files/%'(from #58052), which reads the whole filecache on every cache refresh (30 min TTL). It's in the baseline for now, to be followed up on #58052.Checklist
3. to review, feature component)stable32)AI (if applicable)