feat(sql): lazy last join#3533
Merged
aceforeverd merged 10 commits into4paradigm:mainfrom Oct 16, 2023
Merged
Conversation
For SQL `A last join (B last join C)`, it'll optimize and run `B last join C` lazily. Both batch mode and request(batch-request) mode are considered.
and also: - rm redundant code path in group_and_sort_optimized.cc
aceforeverd
commented
Sep 27, 2023
| /** | ||
| * Resolve column id with given column expression [ColumnRefNode, ColumnId] | ||
| */ | ||
| base::Status ResolveColumnID(const node::ExprNode* column, size_t* column_id) const; |
Collaborator
Author
There was a problem hiding this comment.
delete due to no implementation.
aceforeverd
commented
Sep 27, 2023
| sort, new_in); | ||
| } | ||
|
|
||
| bool GroupAndSortOptimized::SortOptimized( |
aceforeverd
commented
Sep 27, 2023
| &child_column_id, &source_column_id, &source); | ||
|
|
||
| // try loose the relation | ||
| if (!status.isOK() && !col->GetRelationName().empty()) { |
Collaborator
Author
There was a problem hiding this comment.
deleted. do not make sense from try twice
aceforeverd
commented
Sep 27, 2023
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3533 +/- ##
============================================
+ Coverage 75.25% 75.36% +0.10%
Complexity 587 587
============================================
Files 701 717 +16
Lines 129041 129709 +668
Branches 1280 1280
============================================
+ Hits 97115 97751 +636
- Misses 31640 31672 +32
Partials 286 286
☔ View full report in Codecov by Sentry. |
8319e97 to
bd12f46
Compare
correct expr resolving in group_and_sort_optimized
Skip for the case `JOIN(TABLE, ...)`. Cluster optimize only happen with `JOIN(ROW, TABLE)`.
Do not optimize target table if resolved column is from different table, even column name does be the same.
lqy222
approved these changes
Oct 16, 2023
dl239
approved these changes
Oct 16, 2023
aceforeverd
added a commit
to aceforeverd/fedb
that referenced
this pull request
Oct 16, 2023
SQL changes mainly from 4paradigm#3533 and 4paradigm#3554
aceforeverd
added a commit
to aceforeverd/fedb
that referenced
this pull request
Oct 16, 2023
SQL changes mainly from 4paradigm#3533 and 4paradigm#3554
This was referenced Nov 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
support online for SQLs:
t1 last join (t2 last join t3)What's changed:
last join (filter)in request mode with cluster optimized #3531JOIN(ROW, TABLE), skip for cases likeJOIN(TABLE, ...)JOIN (..., JOIN(...))DataProvidernode