New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport-2.1: opt: normalize ANY = ... to IN ... #31271

Merged
merged 1 commit into from Oct 11, 2018

Conversation

Projects
None yet
4 participants
@justinj
Member

justinj commented Oct 11, 2018

Backport 1/1 commits from #30973.

/cc @cockroachdb/release


This commit adds two rules which, in concert, allow a filter of the form

x = ANY ARRAY[...]

to constrain a scan on an index of x.

It's unclear to me if this is a win in the general case, but addressing
the conversation from a couple days ago where we discussed enabling a
placeholder ARRAY to be used instead of a tuple to possible make better
use of the plan cache.

Note this only converts constant arrays, but I don't think there's a reason
we couldn't also do array expressions.

Release note: None

opt: normalize ANY = ... to IN ...
This commit adds two rules which, in concert, allow a filter of the form

    x = ANY ARRAY[...]

to constrain a scan on an index of x.

It's unclear to me if this is a win in the general case, but addressing
the conversation from a couple days ago where we discussed enabling a
placeholder ARRAY to be used instead of a tuple to possible make better
use of the plan cache.

Release note: None

@justinj justinj requested review from nvanbenschoten and RaduBerinde Oct 11, 2018

@justinj justinj requested a review from cockroachdb/sql-opt-prs as a code owner Oct 11, 2018

@cockroach-teamcity

This comment has been minimized.

Show comment
Hide comment
@cockroach-teamcity

cockroach-teamcity Oct 11, 2018

Member

This change is Reviewable

Member

cockroach-teamcity commented Oct 11, 2018

This change is Reviewable

@RaduBerinde

:lgtm:

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@justinj justinj merged commit 6c22a8d into cockroachdb:release-2.1 Oct 11, 2018

2 checks passed

GitHub CI (Cockroach) TeamCity build finished
Details
license/cla Contributor License Agreement is signed.
Details

@justinj justinj deleted the justinj:backport2.1-30973 branch Oct 11, 2018

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