feat(query-engine): prototype streaming query engine#360
Conversation
ba8080f to
4918b79
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #360 +/- ##
==========================================
- Coverage 70.83% 69.90% -0.93%
==========================================
Files 225 236 +11
Lines 17512 18922 +1410
==========================================
+ Hits 12404 13227 +823
- Misses 4183 4691 +508
- Partials 925 1004 +79 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔴 Performance DegradationSome benchmarks have degraded compared to the previous run. Show table
|
🔴 Performance DegradationSome benchmarks have degraded compared to the previous run. Show table
|
cf22e58 to
f9534c5
Compare
a1659f5 to
64a9b26
Compare
7a58d66 to
8d3d79d
Compare
d167fff to
695b657
Compare
4877d35 to
21cd3f4
Compare
🔴 Performance DegradationSome benchmarks have degraded compared to the previous run. Show table
|
b417d52 to
67e6e8a
Compare
… in one phase search
…ion to disable one ohase search
67e6e8a to
5b47f6e
Compare
|
|
||
| getNextTs := getAutoTsGenerator(time.Now(), -time.Nanosecond) | ||
|
|
||
| toBulk := []string{ |
There was a problem hiding this comment.
if it's a single bulk, then we don' test in a cluster env?
| bool explain = 6; | ||
| bool with_total = 7; | ||
| Order order = 8; | ||
| string offset_id = 9; |
There was a problem hiding this comment.
TODO: offset_id not supported
| google.protobuf.Timestamp from = 2; | ||
| google.protobuf.Timestamp to = 3; | ||
| int64 size = 4; | ||
| int64 offset = 5; |
There was a problem hiding this comment.
TODO: we need to establish the API for query engine. Currently, I can set both limit and size and they work both at the same time, which is odd.
| getNextTs := getAutoTsGenerator(time.Now(), -time.Nanosecond) | ||
|
|
||
| toBulk := []string{ | ||
| fmt.Sprintf(`{"ts":%q, "level":3, "service":"service1", "unindexed":"1", "sorted":"1"}`, getNextTs()), |
There was a problem hiding this comment.
I would like to match the behaviour of existing search API. Like service:travel | limit 100 must match ordinary search with size set to 100 with both orders. Ideally both on low and large (thousands) amount of docs.
Currently, I'm running a cluster env and unable to get same results using both old and new API for limit.
| } | ||
| fraction := setupFraction(t, mapping, docs) | ||
|
|
||
| queryString := "level:in(3, 5)" |
There was a problem hiding this comment.
I think it looks like something we would put to fraction_test. We could add tests there (or make a new test) where we would test different expressions written in a new language against different fractions.
However, we will still tests most stuff in integration tests because cluster env tests are a must.
| ErrTooManyFractionTokens = errors.New("aggregation has too many fraction tokens") | ||
| ErrTooManyFractionsHit = errors.New("too many fractions hit") | ||
| ErrMemoryLimitExceeded = errors.New("memory limit exceeded") | ||
| ErrResourceDisabled = errors.New("resource is disabled") |
There was a problem hiding this comment.
what's the concrete meaning of resource here?
| // If zero then there is no limit. | ||
| MaxRegexTokensCheck int `config:"max_regex_tokens_check" default:"0"` | ||
| // EnableOnePhaseSearch enanles experimental one phase search method that supports new query engine. | ||
| EnableOnePhaseSearch bool `config:"enable_one_phase_search"` |
There was a problem hiding this comment.
Even with disabled toggle I can issue a new query service:payment* AND level:5 | sort level asc | limit 100 using complex search and I do not have parse error, but I think I should.
| }; | ||
| } | ||
|
|
||
| rpc OnePhaseSearch(SearchRequest) returns (ComplexSearchResponse) { |
There was a problem hiding this comment.
Duplicating an issue here - currently we must set size even in presence of limit pipe.
| google.protobuf.Timestamp from = 2; | ||
| google.protobuf.Timestamp to = 3; | ||
| int64 size = 4; | ||
| int64 offset = 5; |
|
|
||
| curLeft, curRight *query.Record | ||
|
|
||
| colIdx int |
There was a problem hiding this comment.
since colIdx is exact same for all docs, how do we guarantee all docs have field, let's say amount, on same column index?
Summary
Introduces the foundation for a new streaming search engine that will enable searching by non-indexed fields.
Key Changes
Query Enginewith streamingRecordProducerinterfacefilter,sort,limit,stats,fieldspipesArchitecture
Instead of the traditional two-phase approach (find IDs → fetch documents), this engine streams documents directly through a chain of executors (filter → sort → limit → project), enabling efficient search on non-indexed fields.
If you have used LLM/AI assistance please provide model name and full prompt: