Skip to content

perf: rewrite field:* to _exists_:field - #502

Open
dkharms wants to merge 2 commits into
mainfrom
0-wildcard-to-exists
Open

perf: rewrite field:* to _exists_:field#502
dkharms wants to merge 2 commits into
mainfrom
0-wildcard-to-exists

Conversation

@dkharms

@dkharms dkharms commented Aug 19, 2026

Copy link
Copy Markdown
Member

Description

We can rewrite queries like trace_id:* to _exists_:trace_id in regular search requests. The latter query is significantly lighter and significantly easier to compute because we have special _exists_ index type.

This way we do not need to build huge tree of iterators over all possible token values. The following benchmark proves it -- trace_id is a high-cardinal field while k8s_pod is not:

Query Type mean (ms) stddev (ms) p(50) (ms) p(95) (ms) p(99) (ms) iterations total
basecompdiff basecompdiff basecompdiff basecompdiff basecompdiff basecompdiff basecompdiff
k8s_pod:*
hot 14.791.33-91.02% 1.690.18-89.12% 14.231.34-90.56% 18.741.60-91.44% 46.6631.86-31.72% 47470.00% 10198291019792-0.00%
cold 100.2184.49-15.69% 4.859.72+100.30% 99.3382.52-16.92% 108.22106.53-1.57% 109.86121.06+10.19% 27270.00% 10197351019292-0.04%
trace_id:*
hot 211.081.38-99.35% 4.170.14-96.64% 210.421.39-99.34% 224.591.63-99.27% 256.5131.53-87.71% 4647+2.17% 10198981019556-0.03%
cold 336.3977.91-76.84% 13.453.35-75.07% 333.3177.47-76.76% 360.0192.68-74.26% 373.03104.51-71.98% 2328+21.74% 10193551019146-0.02%

  • I have read and followed all requirements in CONTRIBUTING.md;
  • I used LLM/AI assistance to make this pull request;

If you have used LLM/AI assistance please provide model name and full prompt:

Model: {{model-name}}
Prompt: {{prompt}}

@dkharms dkharms added the performance Features or improvements that positively affect seq-db performance label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔴 Performance Degradation

Some benchmarks have degraded compared to the previous run.
Click on Show table button to see full list of degraded benchmarks.

Show table
Name Previous Current Ratio Verdict
MutexListAppend-4 a73114 4a34dc
194.53 MB/s 174.79 MB/s 0.90 🔴

@dkharms
dkharms marked this pull request as ready for review August 24, 2026 08:59
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.30%. Comparing base (a73114c) to head (22080be).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #502      +/-   ##
==========================================
- Coverage   71.33%   71.30%   -0.03%     
==========================================
  Files         233      233              
  Lines       18999    19012      +13     
==========================================
+ Hits        13552    13557       +5     
- Misses       4419     4425       +6     
- Partials     1028     1030       +2     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eguguchkin eguguchkin added this to the v0.78.0 milestone Aug 24, 2026
@eguguchkin
eguguchkin requested review from forshev and moflotas August 24, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Features or improvements that positively affect seq-db performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants