Skip to content

Conversation

@Wei-hao-Li
Copy link
Collaborator

@Wei-hao-Li Wei-hao-Li commented Aug 5, 2025

Last Cache hit condition:

  1. Select items are all made up of last or last_by;
  2. For last_by, the first argument category type can be tag, attribute or time, the second can only be measurement.

Example:
Schema of table1
image
Hit cases:
select last(s1),last(device),last(time) from table1;
select last(s1),last_by(time,s1),last_by(device,s1) from table1
Miss cases:
select last(s1),last_by(s1,time) from table1;
select last(s1),last_by(s2,s1) from table1

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

Copy link
Contributor

@JackieTien97 JackieTien97 left a 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

Copy link
Contributor

@JackieTien97 JackieTien97 left a 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 JackieTien97 merged commit 829e12a into apache:master Aug 8, 2025
26 of 27 checks passed
@Wei-hao-Li Wei-hao-Li deleted the lastOptimize branch August 8, 2025 07:36
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.

2 participants