Skip to content

Conversation

@reltuk
Copy link
Contributor

@reltuk reltuk commented Jun 16, 2021

No description provided.

@reltuk reltuk requested a review from zachmu June 16, 2021 21:31
case *expression.Equals, *expression.NullSafeEquals:
switch e := expr.(type) {
case *expression.Equals, *expression.NullSafeEquals, *expression.IsNull:
case *expression.Not:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This works because getJoinIndex below is going to look for a complete index and then it's going to take the first partial index that matches. A partial index and applying the conjunction filter after the fact is the better path here.

It's not clear to me why we are so strict in the types of expressions we go after here...if there was an index that matched the expression a.blah LIKE b.like or whatever, wouldn't we want to use it just the same? Isn't any partial index on any portion of the conjunction still going to be correct and be better than no index at all?

Copy link
Member

Choose a reason for hiding this comment

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

We could definitely loosen this up significantly, no reason to restrict it to only equality

@reltuk reltuk merged commit 394c2ef into master Jun 16, 2021
@Hydrocharged Hydrocharged deleted the aaron/indexed-join-uses-indexes-on-and-is-null branch December 8, 2021 07:08
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.

2 participants