Query Engine¶
QilbeeDB's query engine implements OpenCypher with cost-based optimization and vectorized execution.
Architecture¶
Query Processing¶
1. Parsing¶
Convert Cypher text into Abstract Syntax Tree (AST):
2. Planning¶
Generate optimized execution plan with cost-based optimization:
3. Execution¶
Execute plan using physical operators:
- NodeScan: Scan all nodes with label
- IndexSeek: Use index for exact match
- Filter: Apply WHERE predicate
- Expand: Traverse relationships
- Project: Select output columns
Optimization Techniques¶
Index Selection¶
Automatically uses indexes when available:
-- Create index
CREATE INDEX ON :User(email)
-- Fast lookup
MATCH (u:User {email: 'alice@example.com'}) RETURN u
Predicate Pushdown¶
Move filters close to data source to reduce scanned data.
Cardinality Estimation¶
Estimate result sizes for better planning.
Join Reordering¶
Choose optimal join order based on estimated costs.
Performance Tips¶
-
Use Parameters
-
Create Indexes
-
Limit Results
-
Use EXPLAIN
Next Steps¶
- Understand Storage Engine
- Learn about Memory Engine
- Explore Cypher Language