The Wayback Machine - https://web.archive.org/web/20220709005625/https://github.com/cockroachdb/cockroach/issues/80192
Skip to content
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

opt: normalize sequential % in regexes to single % #80192

Open
mgartner opened this issue Apr 19, 2022 · 1 comment · May be fixed by #80432
Open

opt: normalize sequential % in regexes to single % #80192

mgartner opened this issue Apr 19, 2022 · 1 comment · May be fixed by #80432
Labels
C-enhancement good first issue T-sql-queries
Projects

Comments

@mgartner
Copy link
Collaborator

@mgartner mgartner commented Apr 19, 2022

There are several optimization the execution engine can perform when evaluating LIKE patterns with %, which matches zero or any number of any character. For example, see #80073.

Sequential %s can prevent these optimizations, but they are semantically equivalent to a single %, so the optimizer should normalize them to a single %.

For example:

-- The following expressions are equivalent:
col LIKE '%%abc%%%%'
col LIKE '%abc%'

Jira issue: CRDB-15814

@mgartner mgartner added C-enhancement good first issue labels Apr 19, 2022
@mgartner mgartner added this to Triage in SQL Queries via automation Apr 19, 2022
@blathers-crl blathers-crl bot added the T-sql-queries label Apr 19, 2022
@ADustyOldMuffin
Copy link

@ADustyOldMuffin ADustyOldMuffin commented Apr 22, 2022

I'd be interested in taking this on.

@mgartner mgartner moved this from Triage to Backlog in SQL Queries Apr 26, 2022
@jlinder jlinder added sync-me and removed sync-me labels May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement good first issue T-sql-queries
3 participants