Add IContains
for case insensitiveILIKE
: improve performance for "contains" where the needle is ASCII
#6131
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.
DO NOT MERGE
This is superseded by #6145, even if we keep this, we should special case the method defined here to only be used for small haystacks.
Which issue does this PR close?
This continues work from #6118 and #6128 and will require them to be merged before it's fixed, it's the final part of #6107 I think.
Rationale for this change
Lots of context in #6107, this makes
ILIKE
queries which are simply "contains" significantly faster.Benchmarks:
Note, in theory the current regex approach could be faster for very large haystacks, but from my experiments that case will be quite rare, and in many cases the regex will be far far slower, see samuelcolvin/quick-strings#1:
I therefore think it's better to stick to a single implementation than have a branch for very large haystacks.
What changes are included in this PR?
New special case for "case insensitive ascii contains".
Are there any user-facing changes?
No AFAIK,