Skip to content

Commit b949bbc

Browse files
committed
Further adjust comment in get_partition_dispatch_recurse.
In editing 09b12d5 I made it wrong; fix that and try to more clearly explain the situation. Patch by me, reviewed by David Rowley and Amit Langote Discussion: http://postgr.es/m/CA+TgmobAq+mA5hzm0a5OS38qQY5758DDDGqa3sBJN4hvir-H9w@mail.gmail.com
1 parent dbccdd3 commit b949bbc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/backend/executor/execPartition.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -973,11 +973,13 @@ get_partition_dispatch_recurse(Relation rel, Relation parent,
973973
* The 'indexes' array is used when searching for a partition matching a
974974
* given tuple. The actual value we store here depends on whether the
975975
* array element belongs to a leaf partition or a subpartitioned table.
976-
* For leaf partitions we store the 0-based index into *leaf_part_oids,
977-
* and for sub-partitioned tables we store a negative version of the
978-
* 1-based index into the *pds list. When searching, if we see a negative
979-
* value, the search must continue in the corresponding sub-partition;
980-
* otherwise, we've identified the correct partition.
976+
* For leaf partitions we store the index into *leaf_part_oids, and for
977+
* sub-partitioned tables we store a negative version of the index into
978+
* the *pds list. Both indexes are 0-based, but the first element of the
979+
* *pds list is the root partition, so 0 always means the first leaf. When
980+
* searching, if we see a negative value, the search must continue in the
981+
* corresponding sub-partition; otherwise, we've identified the correct
982+
* partition.
981983
*/
982984
pd->indexes = (int *) palloc(partdesc->nparts * sizeof(int));
983985
for (i = 0; i < partdesc->nparts; i++)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy