Skip to content

Optimize query execution in easy count(*) cases#15111

Merged
JackieTien97 merged 3 commits intomasterfrom
OptQuery
Mar 18, 2025
Merged

Optimize query execution in easy count(*) cases#15111
JackieTien97 merged 3 commits intomasterfrom
OptQuery

Conversation

@JackieTien97
Copy link
Contributor

@JackieTien97 JackieTien97 commented Mar 17, 2025

If all seq data, and compaction is well done, we will only need to get one TimeSeriesMetadata to calcuate count for each device. However, according to the profiler result, we found a lot of overhead in SeriesScanUtil, in this pr we will try to save the useless code execution.

  1. needless set in initQueryDatasource in some cases
  2. save device.toString() if cache hit in TimeSeriesMetadataCache
  3. use result of map.get() to judge whether a key exists instead of using map,containsKey before calling map.get

image

@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 73.17073% with 11 lines in your changes missing coverage. Please review.

Project coverage is 39.35%. Comparing base (07e0d21) to head (a157ac0).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
...ne/execution/fragment/FragmentInstanceContext.java 62.50% 6 Missing ⚠️
...torageengine/dataregion/tsfile/TsFileResource.java 75.00% 4 Missing ⚠️
.../storageengine/buffer/TimeSeriesMetadataCache.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #15111   +/-   ##
=========================================
  Coverage     39.35%   39.35%           
  Complexity      193      193           
=========================================
  Files          4596     4596           
  Lines        295732   295806   +74     
  Branches      36856    36876   +20     
=========================================
+ Hits         116386   116424   +38     
- Misses       179346   179382   +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

@JackieTien97 JackieTien97 merged commit c09bb16 into master Mar 18, 2025
52 of 53 checks passed
@JackieTien97 JackieTien97 deleted the OptQuery branch March 18, 2025 07:22
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