KiteSQL icon indicating copy to clipboard operation
KiteSQL copied to clipboard

feat(optimizer): Implement LIKE expression rule for query optimization

Open loloxwg opened this issue 2 years ago • 1 comments

The commit introduces a new rule for the optimization of LIKE operator in SQL queries. The LIKE operator expressions are rewritten to make use of binary operators such as GtEq and Lt in certain cases which enhances the performance of queries. Additionally, new tests for incremented character rule have been added, and LikeRewrite has been added to optimizer rules in the rule set.

What problem does this PR solve?

Add corresponding issue link with summary if exists -->

Issue link:

What is changed and how it works?

Code changes

  • [x] Has Rust code change
  • [ ] Has CI related scripts change

Check List

Tests

  • [x] Unit test
  • [ ] Integration test
  • [ ] Manual test (add detailed scripts or steps below)
  • [ ] No code

Side effects

  • [ ] Performance regression: Consumes more CPU
  • [ ] Performance regression: Consumes more Memory
  • [ ] Breaking backward compatibility

Note for reviewer

loloxwg avatar Nov 12 '23 12:11 loloxwg

It looks good, but it lacks the test of the rules. Reference: https://github.com/KipData/KipSQL/blob/main/src/optimizer/rule/column_pruning.rs#L166

KKould avatar Dec 08 '23 13:12 KKould