Fast pushdown projection - #95
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements fast pushdown projection to improve query performance by filtering columns early in the query processing pipeline. The feature is controlled by the BEACON_ENABLE_PUSHDOWN_PROJECTION configuration flag.
- Adds column collection logic to gather selected columns from query SELECT clauses
- Implements pushdown projection by filtering schemas to only include requested columns
- Adds configuration flag to enable/disable the feature
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| beacon-config/src/lib.rs | Adds configuration flag for enabling pushdown projection |
| beacon-query/src/lib.rs | Implements column collection method for Select enum |
| beacon-query/src/parser.rs | Adds conditional logic to collect columns and pass them for projection |
| beacon-query/src/from.rs | Updates table initialization to support projection parameter |
| beacon-data-lake/src/files/collection.rs | Implements schema filtering for pushdown projection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| let maybe_set_projection: HashSet<String> = HashSet::from_iter(projection.iter().cloned()); | ||
|
|
||
| if !maybe_set_projection.is_empty() { | ||
| // Only keep fields that are in the projection |
There was a problem hiding this comment.
The HashSet maybe_set_projection is created but then immediately checked for emptiness, while the original projection Vec is used for filtering. This creates unnecessary overhead - you can check projection.is_empty() directly and use the Vec for filtering without creating the HashSet.
| let maybe_set_projection: HashSet<String> = HashSet::from_iter(projection.iter().cloned()); | |
| if !maybe_set_projection.is_empty() { | |
| // Only keep fields that are in the projection | |
| // Only keep fields that are in the projection if projection is not empty | |
| if !projection.is_empty() { |
Enable the fast pushdown of selected columns when using the JSON API. This can provide big performance improvements. Its is feature blocked by the flag
BEACON_ENABLE_PUSHDOWN_PROJECTION