|
1 |
| -## KQIR: Kvrocks Query Intermediate Representation |
| 1 | +## KQIR (a.k.a. Kvrocks Search): Kvrocks Query Intermediate Representation |
2 | 2 |
|
3 | 3 | Here, *KQIR* refers to both
|
4 | 4 | - the multiple-level *query intermediate representation* for Apache Kvrocks, and
|
5 | 5 | - the *architecture and toolset* for the query optimization and execution.
|
6 | 6 |
|
| 7 | +Note that when interacting with users, we also refer to KQIR as *Kvrocks Search* to prevent overwhelming with excessive technical information. |
| 8 | + |
7 | 9 | ### Architecture
|
8 | 10 |
|
9 | 11 | 
|
10 | 12 |
|
11 | 13 | ### Components
|
12 | 14 |
|
13 |
| -- User Interface: both SQL and Redis Query syntax is supported to be the frontend language of KQIR |
| 15 | +- User Interface: both SQL and RediSearch Query syntax is supported to be the frontend language of KQIR |
14 | 16 | - SQL Parser: A parser that accepts an extended subset of MySQL syntax
|
15 |
| - - Redis Query Parser: A parser that accepts [Redis query syntax](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax/) (only DIALECT 2 or greater is planned to be supported) |
| 17 | + - Redis Query Parser: A parser that accepts [RediSearch query syntax](https://redis.io/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax/) (only DIALECT 2 or greater is planned to be supported) |
16 | 18 | - KQIR: a multiple level query intermediate representation, currently including two levels (syntactical IR and planning IR)
|
17 | 19 | - Syntactical IR: A high level IR that syntactically represents the query language
|
18 | 20 | - Planning IR: A low level IR that represents plan operators for query execution
|
19 | 21 | - KQIR passes: analysis and transformation procedures on KQIR
|
20 | 22 | - Semantic Checker: to check if there is any semantic errors in the IR
|
21 |
| - - Expression Passes: passes for query expressions, especially for logical expressions |
22 |
| - - Numeric Passes: passes for numeric & arithmetic properties |
23 |
| - - Plan Passes: passes on the plan operators |
| 23 | + - Expression Passes: passes for query expressions, especially for logical/boolean expressions |
| 24 | + - Numeric Passes: passes for numeric & arithmetic expressions utilizing math properties |
| 25 | + - Planning Passes: passes on the plan operators for scheduling a better execution plan |
24 | 26 | - Pass Manager: to manage the pass execution sequence and order
|
25 |
| - - Cost Model: to analyze the cost for the current plan, used by some plan passes |
26 |
| -- Plan Executor: a component for query execution via iterator model |
| 27 | + - Cost Model: to analyze the cost for the current plan, used by some planning passes |
| 28 | +- Plan Executor: a component for query execution via the iterator model |
27 | 29 | - Indexer: to perform the indexing for various types of fields during data changes
|
| 30 | + |
| 31 | +### References |
| 32 | + |
| 33 | +- [KQIR: a query engine for Apache Kvrocks that supports both SQL and RediSearch queries](https://kvrocks.apache.org/blog/kqir-query-engine) |
| 34 | +- [Index encoding format for Kvrocks Search](https://kvrocks.apache.org/community/kvrocks-search-index-encoding) |
0 commit comments