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 VersionInfo SelectionVector creation #4556

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

benjaminwinger
Copy link
Collaborator

Fixes #4271.

The issue was that VersionInfo::getSelVectorForScan (and VectorVersionInfo::getSelVectorForScan) append repeatedly to a SelectionVector and in certain circumstances it will turn a non-empty unfiltered SelectionVector into a filtered one without preserving the former values and then just appending to the end. My solution was to add a new makeDynamic function that copies the old selectedPositions into the mutable buffer before switching them.

E.g. this can occur when the first few VectorVersionInfos have no deletions, such that the first branch is taken in VectorVersionInfo::getSelVectorToScan and it just increases the length of the unfiltered SelectionVector, but then later VectorVersionInfos have deletions, taking the second branch where there is no check for unfiltered data (since it has to be converted to filtered at that point).

One branch of the code was setting the existing SelectionVector to filtered and then appending to it
Existing unfiltered elements would be discarded and replaced with whatever happened to be in the SelectionVector's mutable buffer
@benjaminwinger benjaminwinger changed the title Fix VersionInfo SelVector creation Fix VersionInfo SelectionVector creation Nov 20, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.35%. Comparing base (b08ee3b) to head (14522b0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4556      +/-   ##
==========================================
- Coverage   87.35%   87.35%   -0.01%     
==========================================
  Files        1349     1349              
  Lines       56584    56587       +3     
  Branches     7081     7079       -2     
==========================================
+ Hits        49431    49433       +2     
  Misses       6981     6981              
- Partials      172      173       +1     

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


🚨 Try these New Features:

Copy link

Benchmark Result

Master commit hash: b08ee3b2337018c3dd66512f4a88485ff07c427d
Branch commit hash: 9c613114298aae8dd1dcc9272313cfa15effb078

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 642.81 658.21 -15.41 (-2.34%)
aggregation q28 11423.97 11920.80 -496.83 (-4.17%)
filter q14 127.30 125.08 2.23 (1.78%)
filter q15 128.29 145.68 -17.39 (-11.94%)
filter q16 313.16 302.05 11.11 (3.68%)
filter q17 449.48 448.00 1.48 (0.33%)
filter q18 1925.63 1923.43 2.19 (0.11%)
filter zonemap-node 88.45 87.11 1.34 (1.53%)
filter zonemap-node-lhs-cast 87.93 86.71 1.23 (1.42%)
filter zonemap-rel 5347.66 5521.63 -173.97 (-3.15%)
fixed_size_expr_evaluator q07 576.33 577.29 -0.96 (-0.17%)
fixed_size_expr_evaluator q08 807.49 818.34 -10.85 (-1.33%)
fixed_size_expr_evaluator q09 806.40 808.36 -1.96 (-0.24%)
fixed_size_expr_evaluator q10 241.87 242.49 -0.62 (-0.26%)
fixed_size_expr_evaluator q11 235.09 236.95 -1.85 (-0.78%)
fixed_size_expr_evaluator q12 231.64 230.34 1.30 (0.56%)
fixed_size_expr_evaluator q13 1482.66 1499.30 -16.64 (-1.11%)
fixed_size_seq_scan q23 118.38 115.03 3.34 (2.90%)
join q29 659.31 636.30 23.01 (3.62%)
join q30 1388.00 1309.73 78.28 (5.98%)
join q31 4.79 8.40 -3.61 (-42.95%)
ldbc_snb_ic q35 421.23 431.69 -10.46 (-2.42%)
ldbc_snb_ic q36 109.57 123.92 -14.34 (-11.57%)
ldbc_snb_is q32 5.55 5.38 0.17 (3.20%)
ldbc_snb_is q33 12.10 12.54 -0.44 (-3.50%)
ldbc_snb_is q34 1.65 1.37 0.28 (20.49%)
multi-rel multi-rel-large-scan 1680.04 1659.99 20.05 (1.21%)
multi-rel multi-rel-lookup 5.60 8.74 -3.14 (-35.95%)
multi-rel multi-rel-small-scan 75.81 82.72 -6.91 (-8.35%)
order_by q25 129.96 136.22 -6.26 (-4.59%)
order_by q26 452.35 458.19 -5.84 (-1.27%)
order_by q27 1457.91 1454.24 3.67 (0.25%)
scan_after_filter q01 169.63 173.57 -3.93 (-2.27%)
scan_after_filter q02 154.37 160.51 -6.14 (-3.83%)
shortest_path_ldbc100 q37 91.36 84.68 6.68 (7.88%)
shortest_path_ldbc100 q38 443.85 450.20 -6.35 (-1.41%)
shortest_path_ldbc100 q39 59.83 58.89 0.94 (1.59%)
shortest_path_ldbc100 q40 555.36 550.94 4.42 (0.80%)
var_size_expr_evaluator q03 2103.02 2088.09 14.93 (0.72%)
var_size_expr_evaluator q04 2286.12 2253.24 32.88 (1.46%)
var_size_expr_evaluator q05 2647.63 2625.72 21.91 (0.83%)
var_size_expr_evaluator q06 1321.83 1325.86 -4.03 (-0.30%)
var_size_seq_scan q19 1507.12 1506.60 0.52 (0.03%)
var_size_seq_scan q20 2448.91 2569.60 -120.69 (-4.70%)
var_size_seq_scan q21 2368.15 2330.08 38.06 (1.63%)
var_size_seq_scan q22 127.98 127.24 0.74 (0.58%)

Copy link
Contributor

@ray6080 ray6080 left a comment

Choose a reason for hiding this comment

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

Nice catch. LGTM!

@ray6080 ray6080 merged commit 4f643c1 into master Nov 21, 2024
25 checks passed
@ray6080 ray6080 deleted the version-info-deletion-fix branch November 21, 2024 00:43
ray6080 pushed a commit that referenced this pull request Dec 17, 2024
One branch of the code was setting the existing SelectionVector to filtered and then appending to it
Existing unfiltered elements would be discarded and replaced with whatever happened to be in the SelectionVector's mutable buffer
ray6080 pushed a commit that referenced this pull request Dec 18, 2024
One branch of the code was setting the existing SelectionVector to filtered and then appending to it
Existing unfiltered elements would be discarded and replaced with whatever happened to be in the SelectionVector's mutable buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: ldbc sf01 deleteComment test fail randomly
2 participants