Skip to content

Conversation

KKould
Copy link
Member

@KKould KKould commented Mar 19, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

This rule is used to eliminate simple subqueries and move the filter in the subquery to Left.

select t3.* from t1 as t3 where t3.c = 'D' and t3.a in (select t4.a from t1 as t4 where t4.b = 7);

👇👇👇

select t3.* from t1 as t3 where t3.c = 'D' and t3.b = 7;

part of #17607

Tests

  • Unit Test (TODO)
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Mar 19, 2025
@b41sh b41sh self-requested a review March 19, 2025 10:30
@KKould KKould force-pushed the feat/eliminate_subquery branch 5 times, most recently from 6f63bec to 17ca5a2 Compare March 19, 2025 15:04
@KKould KKould changed the title feat: impl Rule Eliminate Subquery feat: impl Eliminate InSubquery Mar 20, 2025
@KKould KKould force-pushed the feat/eliminate_subquery branch 2 times, most recently from 98c0ac4 to 04747f4 Compare March 20, 2025 07:44
@KKould KKould force-pushed the feat/eliminate_subquery branch from b5a2646 to 5848105 Compare March 20, 2025 17:07
@KKould KKould force-pushed the feat/eliminate_subquery branch from 5848105 to 3fde112 Compare March 21, 2025 01:32
@KKould KKould force-pushed the feat/eliminate_subquery branch from 1ca4ca0 to 292bd15 Compare March 21, 2025 03:51
@KKould KKould requested review from b41sh and BohuTANG March 21, 2025 04:33
@KKould KKould force-pushed the feat/eliminate_subquery branch from 2da1cf1 to 044efde Compare March 21, 2025 11:12
@KKould KKould force-pushed the feat/eliminate_subquery branch from 87bc611 to b1f2c33 Compare March 21, 2025 14:08
@KKould KKould force-pushed the feat/eliminate_subquery branch from b1f2c33 to 965b7ab Compare March 21, 2025 15:28
@b41sh b41sh marked this pull request as draft March 24, 2025 09:44
@KKould KKould closed this Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants