Skip to content

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

Draft
dkharms wants to merge 1 commit into
mainfrom
0-wildcard-to-exists
Draft

perf: rewrite field:* to _exists_:field#502
dkharms wants to merge 1 commit 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.

Back-of-the-envelope benchmarks:

| 0 | | # |   query    | type |            metrics            | |
|   | |---|------------|------|-------------------------------| |
|   | | 0 | trace_id:* | cold | | # |    name     |  value  | | |
|   | |   |            |      | |---|-------------|---------| | |
|   | |   |            |      | | 0 | mean (ms)   |   83.18 | | |
|   | |   |            |      | | 1 | stddev (ms) |   11.33 | | |
|   | |   |            |      | | 2 | p(50) (ms)  |   79.30 | | |
|   | |   |            |      | | 3 | p(95) (ms)  |   96.79 | | |
|   | |   |            |      | | 4 | p(99) (ms)  |  102.81 | | |
|   | |   |            |      | | 5 | iterations  |      24 | | |
|   | |   |            |      | | 6 | total       | 1019553 | | |
| 1 | | # |   query    | type |            metrics            | |
|   | |---|------------|------|-------------------------------| |
|   | | 0 | trace_id:* | cold | | # |    name     |  value  | | |
|   | |   |            |      | |---|-------------|---------| | |
|   | |   |            |      | | 0 | mean (ms)   |  340.77 | | |
|   | |   |            |      | | 1 | stddev (ms) |    9.94 | | |
|   | |   |            |      | | 2 | p(50) (ms)  |  336.56 | | |
|   | |   |            |      | | 3 | p(95) (ms)  |  357.86 | | |
|   | |   |            |      | | 4 | p(99) (ms)  |  381.04 | | |
|   | |   |            |      | | 5 | iterations  |      21 | | |
|   | |   |            |      | | 6 | total       | 1019725 | | |

  • 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 🔴

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.

1 participant