Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit559ec79

Browse files
committed
Small cleanup of create_list_bounds()
When checking for interleaved partitions, we mark the partition asinterleaved when;1. we find an earlier partition index when looping over thesorted-by-Datum indexes[] array, or;2. we find that the NULL partition allows some non-NULL Datum value.In the code, as it was written indb632fb we'll continue to check forcase 2 when we've already marked the partition as interleaved for case 1.Here we make it so we don't bother marking the partition as interleavedfor case 2 when it's already been marked due to case 1.Really all this saves is a useless call to bms_add_member(), but sincethis code is new to PG15, it seems worth fixing it now to save anyone thetrouble of complaining at some time in the future. We have theopportunity to improve this now before PG15 is out. This might ease somefuture back-patching pain.Per report and patch by Zhihong Yu. However, I slightly revised thecomments and altered the bms_add_member() code to match in both locations.We already know that index is equal to boundinfo->null_index from the ifcondition.Author: Zhihong YuDiscussion:https://postgr.es/m/CALNJ-vQbZR0pYxz9zQ5bqXVcwtGgNgVupeEpNT65HZ+yWZnc4g@mail.gmail.comBackpatch-through: 15, same asdb632fb.
1 parent44b5d56 commit559ec79

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎src/backend/partitioning/partbounds.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -648,13 +648,14 @@ create_list_bounds(PartitionBoundSpec **boundspecs, int nparts,
648648
index);
649649

650650
/*
651-
* Mark the NULL partition as interleaved if we find that it
652-
* allows some other non-NULL Datum.
651+
* Otherwise, if the null_index exists in the indexes array,
652+
* then the NULL partition must also allow some other Datum,
653+
* therefore it's "interleaved".
653654
*/
654-
if (partition_bound_accepts_nulls(boundinfo)&&
655-
index==boundinfo->null_index)
655+
elseif (partition_bound_accepts_nulls(boundinfo)&&
656+
index==boundinfo->null_index)
656657
boundinfo->interleaved_parts=bms_add_member(boundinfo->interleaved_parts,
657-
boundinfo->null_index);
658+
index);
658659

659660
last_index=index;
660661
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp