Repository navigation
fix(database): index server name substring searches - #1730
Merged
Merged
Conversation
rdimitrov
marked this pull request as ready for review
October 23, 2026 17:39
This was referenced Oct 23, 2026
1 task
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.
Substring searches use
server_name ILIKE '%term%', which was scanning the production servers table and contending with ordinary listings. Add a GIN trigram index using the existing pg_trgm extension, plus instructions for concurrent construction on populated databases.The index was built concurrently in production on 2026-10-23 and verified valid/ready. Migration 015 skips the existing index, creates it on fresh databases, and rejects an invalid index left by an interrupted build. The transactional migration runner is unchanged. Production benefits immediately; a release is not required to activate this index.
Validation
5d358d3.%,_and backslash matching, latest-version filters, limit=100, exact/latest details and version lists. Median response 0.77 seconds; maximum 6.8 seconds on a one-character search.git diff --checkpassed.Remaining limitations
Brief database readiness failures and connection errors occurred during the build, and another readiness failure occurred at approximately 17:20 UTC after completion (18 listing 5xx responses recorded in subsequent metrics). The database recovered readiness at 17:20:54 UTC. These later failures mean the index must not be described as resolving every availability issue.
One- and two-character searches still took 4–7 seconds in some direct checks. Keep this PR focused on the index; short-search cost and readiness resilience warrant separate investigation. An optional read-only comparison against forced sequential scans hit its five-second statement timeout and was stopped; result equivalence for that additional check was not established. No production records were modified or restored by these checks.