acking-you opened a new pull request, #15462: URL: https://github.com/apache/datafusion/pull/15462
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #11212. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> 1. Add an extended SQL statement targeting this optimization. 2. Provide a description of this extended SQL. 3. Using this optimization, the extended SQL achieves a 2X performance improvement. (If the string length in the filter is longer, the effect can increase linearly because the hits collection only contains two relatively long strings: `URL` and `Title`.) Below is the performance comparison of running the extended SQL locally. It seems there is also some improvement in Q4 (it might be due to testing variance). ``` ┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ┃ Query ┃ main ┃ add_short_circuit ┃ Change ┃ ┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ │ QQuery 0 │ 964.48ms │ 1006.79ms │ no change │ │ QQuery 1 │ 409.89ms │ 419.52ms │ no change │ │ QQuery 2 │ 838.25ms │ 868.74ms │ no change │ │ QQuery 3 │ 408.15ms │ 396.88ms │ no change │ │ QQuery 4 │ 1029.80ms │ 783.40ms │ +1.31x faster │ │ QQuery 5 │ 9429.76ms │ 8835.06ms │ +1.07x faster │ │ QQuery 6 │ 4096.47ms │ 1382.42ms │ +2.96x faster │ └──────────────┴───────────┴───────────────────┴───────────────┘ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓ ┃ Benchmark Summary ┃ ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩ │ Total Time (main) │ 17176.80ms │ │ Total Time (add_short_circuit) │ 13692.80ms │ │ Average Time (main) │ 2453.83ms │ │ Average Time (add_short_circuit) │ 1956.11ms │ │ Queries Faster │ 3 │ │ Queries Slower │ 0 │ │ Queries with No Change │ 4 │ └──────────────────────────────────┴────────────┘ ``` At the same time, while creating this SQL, I also discovered a bug — one of the filter caused a panic: #15461 ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 5. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org