Skip to content

Conversation

jt2594838
Copy link
Contributor

@jt2594838 jt2594838 commented Oct 17, 2025

When repeatedly querying a timeseries that is not in a TsFile and the bloomfilter fails to filter it, each query will result in a necessary IO.

Since TsFile is immutable, we can cache a placeholder to indicate the non-existence.

In a test, 10000 series were written into a TsFile, then 20000 series (only 10000 exist) were queried from the file.
The result shows a significant reduction in query time.

warming up
Do not cache non-exist series
time cost with outer k: 460ms
time cost with inner k: 199ms
Cache non-exist series
time cost with outer k: 200ms
time cost with inner k: 151ms
actual test
Do not cache non-exist series
time cost with outer k: 189ms
time cost with inner k: 187ms
Cache non-exist series
time cost with outer k: 156ms
time cost with inner k: 152ms

For 0.25M timeseries

warming up
Do not cache non-exist series
time cost with outer k: 15580ms
time cost with inner k: 13881ms
Cache non-exist series
time cost with outer k: 11843ms
time cost with inner k: 10173ms
actual test
Do not cache non-exist series
time cost with outer k: 14940ms
time cost with inner k: 13383ms
Cache non-exist series
time cost with outer k: 11451ms
time cost with inner k: 10177ms

For 1M timeseries

warming up
Do not cache non-exist series
time cost with outer k: 67343ms
time cost with inner k: 55918ms
Cache non-exist series
time cost with outer k: 65831ms
time cost with inner k: 43465ms
actual test
Do not cache non-exist series
time cost with outer k: 67438ms
time cost with inner k: 56995ms
Cache non-exist series
time cost with outer k: 56674
time cost with inner k: 45369ms

Copy link

Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.67%. Comparing base (0d0b7d1) to head (1cd27fa).

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #16606   +/-   ##
=========================================
  Coverage     38.67%   38.67%           
  Complexity      207      207           
=========================================
  Files          4938     4938           
  Lines        326978   326992   +14     
  Branches      41503    41505    +2     
=========================================
+ Hits         126460   126476   +16     
+ Misses       200518   200516    -2     

☔ 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.

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.

1 participant