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

Fix NULL handling for in-memory tuple filtering #7557

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

antekresic
Copy link
Contributor

During DML decompression, we filter out batches that don't need decompression using in-memory filtering which filters compressed tuples using scankeys. Those scankeys were not detecting NULL values correctly for unique constraints which use NULLS NOT DISTINCT setting. This change uses existing codebase to properly detect those tuples when using SK_ISNULL flag.

@antekresic antekresic self-assigned this Dec 20, 2024
@antekresic antekresic added this to the TimescaleDB 2.18.0 milestone Dec 20, 2024
@antekresic antekresic requested a review from svenklemm December 20, 2024 13:51
@antekresic antekresic marked this pull request as ready for review December 20, 2024 13:51
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.21%. Comparing base (59f50f2) to head (a488025).
Report is 667 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7557      +/-   ##
==========================================
+ Coverage   80.06%   82.21%   +2.14%     
==========================================
  Files         190      231      +41     
  Lines       37181    43380    +6199     
  Branches     9450    10911    +1461     
==========================================
+ Hits        29770    35665    +5895     
- Misses       2997     3392     +395     
+ Partials     4414     4323      -91     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

int cur_nkeys = nkeys;
ScanKey cur_key = keys;

for (; cur_nkeys--; cur_key++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some creative for loop 😅

@antekresic antekresic enabled auto-merge (rebase) December 23, 2024 12:50
During DML decompression, we filter out batches that don't
need decompression using in-memory filtering which filters
compressed tuples using scankeys. Those scankeys were not
detecting NULL values correctly for unique constraints
which use NULLS NOT DISTINCT setting. This change uses
existing codebase to properly detect those tuples when
using SK_ISNULL flag.
@antekresic antekresic merged commit 1983063 into timescale:main Dec 23, 2024
47 checks passed
@timescale-automation
Copy link

Automated backport to 2.17.x not done: cherry-pick failed.

Git status

HEAD detached at origin/2.17.x
You are currently cherry-picking commit 19830632d.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   .unreleased/pr_7557
	modified:   tsl/src/compression/compression_dml.c
	modified:   tsl/src/compression/compression_dml.h
	modified:   tsl/src/compression/compression_scankey.c
	modified:   tsl/test/shared/expected/compression_nulls_not_distinct.out
	modified:   tsl/test/shared/sql/compression_nulls_not_distinct.sql

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   tsl/src/compression/recompress.c


Job log

@timescale-automation timescale-automation added the auto-backport-not-done Automated backport of this PR has failed non-retriably (e.g. conflicts) label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport-not-done Automated backport of this PR has failed non-retriably (e.g. conflicts) bug compression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants