From 4554366c32d5b0cb362c0c39514bdbe699c832aa 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 fe48d7af20b..8bcc8f11a57 100644
--- a/src/include/nodes/pathnodes.h
+++ b/src/include/nodes/pathnodes.h
@@ -316,6 +316,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;
 
@@ -339,12 +345,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

