Bug fix: ensure OR expressions on a single table use an index when possible#2123
Merged
Bug fix: ensure OR expressions on a single table use an index when possible#2123
Conversation
…ver doltgres-specific expression nodes in a filter
Contributor
|
Contributor
Footnotes
|
Hydrocharged
approved these changes
Dec 16, 2025
Collaborator
Hydrocharged
left a comment
There was a problem hiding this comment.
Overall looks fine, but as mentioned in the GMS PR, you should add this to sql.EngineOverrides instead of replacing another function within Init. Right now we're assembling everything in the servercfg, but I'm going to be changing that today since it's causing issues with hosted deployment and I need to get a fix out for that quickly, but for everything new, it should go in the overrides.
codeaucafe
added a commit
to codeaucafe/doltgresql
that referenced
this pull request
Dec 20, 2025
Remove skip list entries for tests that were previously panicking due to a bug in go-mysql-server's index range building for OR conditions. The bug occurred when OR conditions mixed indexed and non-indexed columns (e.g., `SELECT * FROM t WHERE pk = 1 OR col = 1`). I believe the issue was fixed in PR dolthub#2123, which implemented a LogicTreeWalker for DoltgreSQL that properly handles doltgres-specific expression nodes when analyzing filters for index usage on OR expressions. Tests removed from skip list: - Complex Filter Index Scan dolthub#2 - Complex Filter Index Scan dolthub#3 - complicated range tree All three tests now pass. Refs: dolthub#1868
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.
This fixes the performance regression in select_random_ranges, which uses
BETWEEN .. OR BETWEEN ..in its filters.Requires dolthub/go-mysql-server#3347