-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement last cache optimize for query like select last(s1), last(s1, time), last(s2), last(s2, time) #16103
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
Merged
Conversation
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
Signed-off-by: Weihao Li <[email protected]>
…date Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
JackieTien97
requested changes
Aug 6, 2025
Contributor
JackieTien97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some perf experiment results and current last cache hit condition in pr descriptions
...e/iotdb/db/queryengine/execution/operator/source/relational/aggregation/LastAccumulator.java
Outdated
Show resolved
Hide resolved
...iotdb/db/queryengine/execution/operator/source/relational/aggregation/LastByAccumulator.java
Show resolved
Hide resolved
...anode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
Show resolved
Hide resolved
...ache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java
Outdated
Show resolved
Hide resolved
...anode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
Outdated
Show resolved
Hide resolved
...iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java
Outdated
Show resolved
Hide resolved
...iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java
Outdated
Show resolved
Hide resolved
...iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java
Show resolved
Hide resolved
...iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java
Show resolved
Hide resolved
...iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java
Show resolved
Hide resolved
JackieTien97
requested changes
Aug 6, 2025
Contributor
JackieTien97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add IT case:
// insert into
// delete from table1 where time >= 1;
// select last(time), last(s1) from table1;
// select last(time), last(s1) from table1;
Signed-off-by: Weihao Li <[email protected]>
Signed-off-by: Weihao Li <[email protected]>
JackieTien97
approved these changes
Aug 8, 2025
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.
Last Cache hit condition:
lastorlast_by;last_by, the first argument category type can betag,attributeortime, the second can only bemeasurement.Example:

Schema of table1
Hit cases:
select last(s1),last(device),last(time) from table1;select last(s1),last_by(time,s1),last_by(device,s1) from table1Miss cases:
select last(s1),last_by(s1,time) from table1;select last(s1),last_by(s2,s1) from table1Performance Test

Data generation:disable out_of_order write,1000 device * 50 sensor,client_number=10,loop=100,batch_size=100,disable all compaction