0002-Compact-PlannerInfo-to-restore-its-previous-20250220.patch
text/x-patch
Filename: 0002-Compact-PlannerInfo-to-restore-its-previous-20250220.patch
Type: text/x-patch
Part: 3
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0002
Subject: Compact PlannerInfo to restore its previous size
| File | + | − |
|---|---|---|
| src/include/nodes/pathnodes.h | 6 | 6 |
From 5b14bed22abd3c2e2ff4fb03f94eedb6b1dbd345 Mon Sep 17 00:00:00 2001 From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Date: Mon, 7 Oct 2024 19:48:17 +0530 Subject: [PATCH 2/6] Compact PlannerInfo to restore its previous size Previous commit added a new member to PlannerInfo increasing its size from 696 to 704 bytes in size on my laptop. This change coincides with a potential planning time regression for query involving partitioned tables with lower number of partitios (around 100 or less) and lower number of joins between partitioned tables. This commit rearranges the members of PlannerInfo so that the size is back to 696. We should merge this commit into previous commit in case this fixes the regression, otherwise discard it. Ashutosh Bapat --- src/include/nodes/pathnodes.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h index 83dc2ea3781..25689e5c5a6 100644 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@ -337,6 +337,12 @@ struct PlannerInfo /* set true once ECs are canonical */ bool ec_merging_done; + /* counter for assigning RestrictInfo serial numbers */ + int last_rinfo_serial; + + /* Hash table to store and retrieve child RestrictInfos. */ + struct HTAB *child_rinfo_hash pg_node_attr(read_write_ignore); + /* list of "canonical" PathKeys */ List *canon_pathkeys; @@ -360,12 +366,6 @@ struct PlannerInfo /* list of SpecialJoinInfos */ List *join_info_list; - /* counter for assigning RestrictInfo serial numbers */ - int last_rinfo_serial; - - /* Hash table to store and retrieve child RestrictInfos. */ - struct HTAB *child_rinfo_hash pg_node_attr(read_write_ignore); - /* * all_result_relids is empty for SELECT, otherwise it contains at least * parse->resultRelation. For UPDATE/DELETE/MERGE across an inheritance -- 2.34.1