-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
colfetcher: produce batches only of needed columns
This commit updates the cFetcher to operate only on the needed columns. Previously, it would get all columns present in the whole table and create `coldata.Batch`es for each of the columns, even when only a subset of columns is needed (or even available if the index is not covering). For example, imagine we have a table like ``` t (a INT PRIMARY KEY, b INT, c INT, d INT, INDEX b_idx (b)) ``` and we have a query like `SELECT b FROM t@b_idx`. Previously, we would create a batch with 4 `int64` columns with only 1 (for column `b`) being actually populated and all others marked as "not needed" and set to all NULL values. This is suboptimal, and this commit refactors things so that a batch with only a single vector is created. This is achieved in two steps: - first, we populate the slice of column descriptors that are accessible from the index. These are all columns of the table for covering indexes. For non-covering secondary indexes we only keep columns present in the index - next, we examine the set of columns that need to be fetched and prune all not needed columns away. Note that we are always careful to update the post-processing spec accordingly so that the spec always refers to correct new ordinals. It's worth pointing out that since we're modifying the spec directly, we had to introduce some special logic to keep the original state of the `PostProcessSpec` in order for the flow diagrams to refer to the original columns. Release note: None
- Loading branch information
1 parent
61f736a
commit 8e40f1c
Showing
23 changed files
with
781 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.