Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport to 2.18.x: #7661: Optimize quals on segmentby columns in ColumnarScan #7671

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

timescale-automation
Copy link
Member

This is an automated backport of #7661: Optimize quals on segmentby columns in ColumnarScan.
This PR will be merged automatically after all the relevant CI checks pass. If this fix should not be backported, or will be backported manually, just close this PR. You can use the backport branch to add your changes, it won't be modified automatically anymore.

For more details, please see the documentation

Original description

Optimize quals on segmentby columns in ColumnarScan

When filtering arrow slots in ColumnarScan, quals on segmentby columns should be executed separately from those on other columns because they don't require decompression and might filter the whole arrow slot in one go. Furthermore, the quals only need to be applied once per arrow slot since the segmentby value is the same for all compressed rows in the slot.

This will speed up scans when filters on segmentby columns cannot be pushed down to Hypercore TAM as scankeys. For example, " IN (1, 2, 3)" won't be pushed down as a scankey because only index scans support scankeys with such scalar array expressions.

Disable-check: force-changelog-file
Disable-check: commit-count

When filtering arrow slots in ColumnarScan, quals on segmentby columns
should be executed separately from those on other columns because they
don't require decompression and might filter the whole arrow slot in
one go. Furthermore, the quals only need to be applied once per arrow
slot since the segmentby value is the same for all compressed rows in
the slot.

This will speed up scans when filters on segmentby columns cannot be
pushed down to Hypercore TAM as scankeys. For example, "<column> IN
(1, 2, 3)" won't be pushed down as a scankey because only index scans
support scankeys with such scalar array expressions.

(cherry picked from commit 8cff1c2)
Fix a bug when backwards scanning a ColumnarScan and add a test case.

(cherry picked from commit cde8185)
@timescale-automation timescale-automation added the is-auto-backport PR created by backport automation label Feb 7, 2025
@timescale-automation timescale-automation enabled auto-merge (rebase) February 7, 2025 16:27
@timescale-automation timescale-automation merged commit 19cc79f into 2.18.x Feb 7, 2025
43 checks passed
@timescale-automation timescale-automation deleted the backport/2.18.x/7661 branch February 7, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-auto-backport PR created by backport automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants