Skip to content

Conversation

@englefly
Copy link
Contributor

@englefly englefly commented Jul 25, 2023

Proposed changes

  1. eliminate emptyrelation,
  2. const fold after filter pushdown

Issue Number: close #xxx

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@englefly
Copy link
Contributor Author

run buildall

@englefly englefly marked this pull request as ready for review July 26, 2023 07:28
@englefly englefly changed the title ds11 [tpcds](nereids) add rule to eliminate empty relation Jul 26, 2023
@englefly
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 46.77 seconds
stream load tsv: 505 seconds loaded 74807831229 Bytes, about 141 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.1 seconds inserted 10000000 Rows, about 343K ops/s
storage size: 17166576262 Bytes

@englefly
Copy link
Contributor Author

run buildall

@englefly
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.42 seconds
stream load tsv: 542 seconds loaded 74807831229 Bytes, about 131 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.2 seconds inserted 10000000 Rows, about 342K ops/s
storage size: 17165981792 Bytes

@englefly
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 47.3 seconds
stream load tsv: 532 seconds loaded 74807831229 Bytes, about 134 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.1 seconds inserted 10000000 Rows, about 343K ops/s
storage size: 17166327359 Bytes

@englefly
Copy link
Contributor Author

englefly commented Aug 1, 2023

run buildall

@englefly
Copy link
Contributor Author

englefly commented Aug 3, 2023

run buildall

@hello-stephen
Copy link
Contributor

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 46.82 seconds
stream load tsv: 506 seconds loaded 74807831229 Bytes, about 140 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.4 seconds inserted 10000000 Rows, about 340K ops/s
storage size: 17164985798 Bytes

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

PR approved by anyone and no changes requested.

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Aug 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

PR approved by at least one committer and no changes requested.

@englefly englefly merged commit 62b1a7b into apache:master Aug 4, 2023
@englefly englefly deleted the ds11 branch August 4, 2023 04:49
xiaokang pushed a commit that referenced this pull request Aug 11, 2023
1. eliminate emptyrelation,
2. const fold after filter pushdown
morrySnow added a commit that referenced this pull request Dec 18, 2025
Related PR: #22203

Problem Summary:

This pull request refines the logic in the `EliminateEmptyRelation`
rewrite rule, focusing on how set operations (`UNION` and `EXCEPT`)
handle empty relations in query plans. The changes improve efficiency
and code clarity by processing only when necessary, optimizing builder
usage, and simplifying project and aggregate node construction.

**Set Operation Handling Improvements:**

* Updated the logic for `UNION` nodes to only process and eliminate
empty relation children when at least one is present, reducing
unnecessary computation. Builders are now initialized with expected
sizes for efficiency, and redundant code for handling constant
expressions was removed.
* Improved handling of `EXCEPT` nodes by checking for empty relations
only among the right-hand children, and optimizing builder
initialization. The construction of aggregate and project nodes now uses
the correct outputs directly, streamlining the process.
github-actions bot pushed a commit that referenced this pull request Dec 18, 2025
Related PR: #22203

Problem Summary:

This pull request refines the logic in the `EliminateEmptyRelation`
rewrite rule, focusing on how set operations (`UNION` and `EXCEPT`)
handle empty relations in query plans. The changes improve efficiency
and code clarity by processing only when necessary, optimizing builder
usage, and simplifying project and aggregate node construction.

**Set Operation Handling Improvements:**

* Updated the logic for `UNION` nodes to only process and eliminate
empty relation children when at least one is present, reducing
unnecessary computation. Builders are now initialized with expected
sizes for efficiency, and redundant code for handling constant
expressions was removed.
* Improved handling of `EXCEPT` nodes by checking for empty relations
only among the right-hand children, and optimizing builder
initialization. The construction of aggregate and project nodes now uses
the correct outputs directly, streamlining the process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/2.0.1-merged merge_conflict reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants