[ 
https://issues.apache.org/jira/browse/CALCITE-7906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134466#comment-18134466
 ] 

Julian Hyde commented on CALCITE-7906:
--------------------------------------

Can you give one or two examples in the description of a LIKE pattern, the 
regex we used to translate to, and the new regex?

Can you add one Quidem test? I'm guessing that it's possible to write a query 
like 'select * from emp where ename like '%J%E%S%' that is very slow if this 
bug has not been fixed.

> LikePattern matching time grows exponentially with the number of '%' wildcards
> ------------------------------------------------------------------------------
>
>                 Key: CALCITE-7906
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7906
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.43.0
>
>
> LikePattern.likeToRegex turns each % into .* and matches with 
> java.util.regex. A pattern with many wildcards makes the regex engine 
> backtrack heavily when the name doesn't match.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to