Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Reduce fragment plan size #29719

Merged
merged 3 commits into from
Aug 24, 2023
Merged

[Enhancement] Reduce fragment plan size #29719

merged 3 commits into from
Aug 24, 2023

Conversation

Seaven
Copy link
Contributor

@Seaven Seaven commented Aug 22, 2023

Fixes #issue

in complex query(a lot of union/expression/select-columns), will make the fragment plan very large.
a SlotDescriptor size is 100 byte, 1000+ column will be 100k, so the whole fragment plan reach 1-2MB easily.
In x10 BE cluster, a FE's network output bandwidth will reach 10-20MB, and reach 500MB when FE support 50QPS

  • Change unused paramter in thrift
  • Add scalar operator rewrite when merge project

to handle union sql like:

select * from t0 union all select 1, 1, 1 from t1

before:

  4:Project
  |  <slot 10> : 16: cast
  |  <slot 11> : CAST(1 AS BIGINT)
  |  <slot 12> : CAST(1 AS BIGINT)
  |  common expressions:
  |  <slot 16> : CAST(1 AS BIGINT)
  |  
  3:OlapScanNode
     TABLE: t1
     PREAGGREGATION: ON
     partitions=0/1
     rollup: t1
     tabletRatio=0/0
     tabletList=
     cardinality=1
     avgRowSize=4.0

after:

  4:Project
  |  <slot 10> : 1
  |  <slot 11> : 1
  |  <slot 12> : 1
  |  
  3:OlapScanNode
     TABLE: t1
     PREAGGREGATION: ON
     partitions=0/1
     rollup: t1
     tabletRatio=0/0
     tabletList=
     cardinality=1
     avgRowSize=25.0

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.1
    • 3.0
    • 2.5
    • 2.4

@mergify mergify bot assigned Seaven Aug 22, 2023
Signed-off-by: Seaven <seaven_7@qq.com>
Seaven added 2 commits August 23, 2023 11:10
Signed-off-by: Seaven <seaven_7@qq.com>
Signed-off-by: Seaven <seaven_7@qq.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@wanpengfei-git
Copy link
Collaborator

[FE Incremental Coverage Report]

😍 pass : 25 / 25 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/analysis/TupleDescriptor.java 4 4 100.00% []
🔵 com/starrocks/analysis/SlotDescriptor.java 16 16 100.00% []
🔵 com/starrocks/sql/optimizer/rule/transformation/MergeTwoProjectRule.java 5 5 100.00% []

@wanpengfei-git
Copy link
Collaborator

[BE Incremental Coverage Report]

😍 pass : 4 / 4 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 src/runtime/descriptors.cpp 4 4 100.00% []

@Seaven Seaven merged commit 1b32651 into StarRocks:main Aug 24, 2023
Jay-ju pushed a commit to Jay-ju/starrocks that referenced this pull request Sep 7, 2023
* [Enhancement] Reduce fragment plan size

Signed-off-by: Seaven <seaven_7@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants