zhiqiang-hhhh opened a new pull request, #45422:
URL: https://github.com/apache/doris/pull/45422

   ### What problem does this PR solve?
   
   Related PR: https://github.com/apache/doris/pull/45414
   
   Problem Summary:
   
   https://github.com/apache/doris/pull/45414 optimized short circuit of 
CompoundPred. But for some cases, it will introduce perf recession since AND/OR 
process of CompoundPred is not as efficient as Function AND/OR.
   
   Previous
   ```sql
   mysqlslap -hd3 -uroot -P9130  --create-schema=test_db -c 10 -i 100 -q 
"SELECT count(k) FROM sbtest1 WHERE k BETWEEN 10809931 AND 16922183 OR k 
BETWEEN 17788920 AND 27291942 OR k BETWEEN 23293962 AND 24940261 OR k BETWEEN 
28108000 AND 28870202 OR k BETWEEN 23014347 AND 26008115 OR k BETWEEN 17817024 
AND 29749077 OR k BETWEEN 8776291 AND 19869309 OR k BETWEEN 12846851 AND 
15917660 OR k BETWEEN 21899521 AND 25614482 OR k BETWEEN 4850578 AND 8454295;"
   Benchmark
       Average number of seconds to run all queries: 0.315 seconds
       Minimum number of seconds to run all queries: 0.307 seconds
       Maximum number of seconds to run all queries: 0.328 seconds
       Number of clients running queries: 10
       Average number of queries per client: 1
   ```
   Now
   ```sql
   mysqlslap -hd3 -uroot -P9130  --create-schema=test_db -c 10 -i 100 -q 
"SELECT count(k) FROM sbtest1 WHERE k BETWEEN 10809931 AND 16922183 OR k 
BETWEEN 17788920 AND 27291942 OR k BETWEEN 23293962 AND 24940261 OR k BETWEEN 
28108000 AND 28870202 OR k BETWEEN 23014347 AND 26008115 OR k BETWEEN 17817024 
AND 29749077 OR k BETWEEN 8776291 AND 19869309 OR k BETWEEN 12846851 AND 
15917660 OR k BETWEEN 21899521 AND 25614482 OR k BETWEEN 4850578 AND 8454295;"
   Benchmark
        Average number of seconds to run all queries: 0.222 seconds
        Minimum number of seconds to run all queries: 0.215 seconds
        Maximum number of seconds to run all queries: 0.263 seconds
        Number of clients running queries: 10
        Average number of queries per client: 1
   ```
   BTW, the performance recession only occurs when compound predicate can be 
short circuited in most cases.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to