perf: rewrite field:* to _exists_:field - #502
Open
dkharms wants to merge 2 commits into
Open
Conversation
Contributor
🔴 Performance DegradationSome benchmarks have degraded compared to the previous run. Show table
|
dkharms
marked this pull request as ready for review
August 24, 2026 08:59
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
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.
Description
We can rewrite queries like
trace_id:*to_exists_:trace_idin 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_idis a high-cardinal field whilek8s_podis not:mean (ms)stddev (ms)p(50) (ms)p(95) (ms)p(99) (ms)iterationstotal14.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%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%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%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%If you have used LLM/AI assistance please provide model name and full prompt: