Pushdown some expressions to Dict layout reader#8341
Open
myrrc wants to merge 1 commit into
Open
Conversation
Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
Merging this PR will degrade performance by 11.93%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | bitwise_not_vortex_buffer_mut[128] |
215.3 ns | 244.4 ns | -11.93% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing myrrc/pushdown-dict (e64f2a2) with develop (3d7bbfb)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we access values of Dict layout reader, it canonicalizes them and stores
them in a SharedArray. This means we always pay the cost of canonicalization
which in turn means we can't do #8310 .
In order to solve this issue, we need to apply some expressions to the values
array before canonicalizing it. However, we can't push down arbitrary
expressions as it may be beneficial to apply them over canonicalized array.
One example of such expressions is LIKE over a Dict array with few codes used.
Applying LIKE to whole values array is not beneficial.
This PR adds a hardcoded internal is_negative_cost estimation for expressions
that we want to push before canonicalization. A hint for these are expressions
which don't depend on individual input size. As an example, for every string,
len(string) doesn't read the string itself but reads the metadata and thus is
O(1) on individual input.
We don't push down fallible (like cast) or null sensitive (like IS NULL)
expressions as well because we want to propagate the errors at call site
rather than upfront.