From 786fa3bdb95b727af2b61b275ef7728dbc02bfab Mon Sep 17 00:00:00 2001
From: Tomas Vondra <tomas@vondra.me>
Date: Wed, 25 Nov 2026 13:47:05 +0100
Subject: [PATCH v7 12/30] GEQO: Count starjoin dimensions as fewer rels toward
 geqo_threshold

The standard join search joins the dimensions of a starjoin cluster to
the fact only in the canonical order, so it considers only d+1 of the
2^d subsets of the d dimensions.  Joinrels without the fact may contain
at most one of the dimensions, so that's d+1 subsets too.  So count the
dimensions as only ceil(log2(d+1)) rels toward geqo_threshold.  With the
default settings, stars with 11 or more dimensions are now planned by
the standard join search instead of GEQO, which is much cheaper.

Not counting the dimensions at all would not be safe, because each
cluster still multiplies the number of joinrels by d+1.

Update STARJOINS.md, and the documentation of geqo_threshold and
enable_starjoin_ordering.  Update the starjoin_geqo checks, which now
show that such stars are planned by the standard join search, unless
excluded dimensions or other rels push the count above geqo_threshold.
---
 STARJOINS.md                                | 49 ++++++++---
 doc/src/sgml/config.sgml                    | 11 ++-
 src/backend/optimizer/path/allpaths.c       |  7 +-
 src/backend/optimizer/path/joinrels.c       | 37 ++++++++-
 src/include/optimizer/paths.h               |  1 +
 src/test/regress/expected/starjoin_geqo.out | 90 +++++++++++++++++----
 src/test/regress/sql/starjoin_geqo.sql      | 59 ++++++++++----
 7 files changed, 207 insertions(+), 47 deletions(-)

diff --git a/STARJOINS.md b/STARJOINS.md
index 578548de587..a1cfca87b96 100644
--- a/STARJOINS.md
+++ b/STARJOINS.md
@@ -36,7 +36,8 @@ the search considers.  But the orders may still differ in cost (e.g. due
 to different widths of the dimensions), so the planner may occasionally
 miss a cheaper plan.  A relation treated as a dimension although its
 join does not preserve the fact rows can only make the planner miss a
-cheaper plan too, e.g. by postponing a selective join.
+cheaper plan too, e.g. by postponing a selective join.  It can also make
+the planner use the standard join search instead of GEQO.
 
 ### Parts
 
@@ -45,6 +46,7 @@ The optimization consists of these parts:
 - The `enable_starjoin_ordering` GUC (on by default), documented with
   the other planner method configuration parameters.  With the GUC
   disabled, no clusters are built, so the join search is not restricted.
+  The dimensions then count fully toward `geqo_threshold`.
 - `generate_starjoin_clusters` determines the starjoin clusters of the
   query.  `query_planner` calls it after matching the foreign keys to
   the join clauses, once the lateral, placeholder and special join
@@ -60,6 +62,8 @@ The optimization consists of these parts:
 - `starjoin_setup_subproblem`, called by `make_rel_from_joinlist` for
   each join search subproblem, determines the dimensions to check in the
   subproblem.
+- `starjoin_geqo_levels` counts the dimensions as fewer rels toward
+  `geqo_threshold`.
 
 The clusters are determined in `src/backend/optimizer/plan/initsplan.c`,
 and the join order is restricted in
@@ -229,6 +233,28 @@ can't be joined yet remains a separate clump.  GEQO tries to merge it
 again whenever the clump with the fact grows, and at the end it
 force-joins the remaining clumps, so it still finds a plan.
 
+The standard join search joins the dimensions of a cluster to the fact
+only in the canonical order, so it considers only d+1 of the 2^d subsets
+of the d dimensions.  Joinrels without the fact may contain at most one
+of the dimensions, so that's d+1 subsets too.  So `starjoin_geqo_levels`
+counts the dimensions as only ceil(log2(d+1)) rels toward
+`geqo_threshold`.  The dimensions are those `starjoin_setup_subproblem`
+determined for the subproblem, so a cluster has none if its fact is not
+part of the subproblem, as the order is not enforced without the fact.
+`join_search_hook` gets the number of initial rels without this
+discount.
+
+A FROM list of tables is never split into join search subproblems, so
+with the default settings a star with 11 or more dimensions would
+otherwise be planned by GEQO.  With the discount, it's planned by the
+standard join search, which is much cheaper.  A star with 11 dimensions
+takes 0.3ms to plan instead of 20ms, and a star with 100 dimensions 6ms,
+compared to 300ms with GEQO.  Not counting the dimensions at all would
+not be safe, because each cluster still multiplies the number of
+joinrels by d+1.  For example, for a query joining 4 facts with 10
+dimensions each, the standard join search would take 1.2s and 440MB,
+compared to 120ms with GEQO.
+
 ## Conditions for a dimension
 
 A relation is a dimension of a fact if it's referenced by a foreign key
@@ -371,26 +397,25 @@ the plans, the planning cost, or the regression tests.
   joininfo list of every rel, and every dimension appears to have join
   clauses to rels other than the fact.  So a single such qual disables
   all starjoin clusters in the query, even if it's in the ON clause of a
-  single dimension's join.  Ignoring pseudoconstant quals when building
-  the clusters would be enough to fix this.  The quals would still make
-  the dimensions joinable to each other without the fact, but such
-  joinrels are restricted (see `starjoin_order_invalid`).
+  single dimension's join.  The dimensions then count fully toward
+  `geqo_threshold`, so with the default settings a star with 11
+  dimensions gets planned by GEQO.  Ignoring pseudoconstant quals when
+  building the clusters would be enough to fix this.  The quals would
+  still make the dimensions joinable to each other without the fact, but
+  such joinrels are restricted (see `starjoin_order_invalid`).
 - A dimension gets joined to the fact at its position in the canonical
   order, so if a rel without join clauses is joined to a dimension
   that's not the last one, the joins of the following dimensions process
   the multiplied rows.  The clauseless_first_cost_higher check in
   starjoin_other shows this, for a star with two scans of a 2-row table
   without join clauses.
-- A FROM list of tables is never split into join search subproblems, so
-  with the default settings a star with 11 or more dimensions is planned
-  by GEQO, even though the canonical order makes the number of joinrels
-  in the standard join search linear in the number of dimensions.  For a
-  star with 11 dimensions, planning takes 20ms with the GUC enabled
-  (18ms with the GUC disabled), while the standard join search takes
-  0.3ms (the star_list_standard_search check in starjoin_geqo).
 - GEQO evaluates a fixed number of join orders, so enforcing the
   canonical order in GEQO only adds overhead, and the GUC changes the
   GEQO plans (the geqo_plan_unaffected check in starjoin_geqo).
+- `join_search_hook` gets the number of initial rels without the
+  discount, so an extension implementing its own join search has to call
+  `starjoin_geqo_levels` to make the same choice between the standard
+  join search and GEQO.
 
 ## Regression tests
 
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 7ee22a69589..6f2864fc36b 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -6330,6 +6330,13 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
         same number of rows, and the planner considers only one of them.
         This can significantly reduce planning time for queries joining many
         dimension tables, but may occasionally miss a cheaper join order.
+        When comparing the number of <literal>FROM</literal> items to
+        <xref linkend="guc-geqo-threshold"/>, <replaceable>N</replaceable>
+        such dimension tables of a fact table, appearing as separate items in
+        the same <literal>FROM</literal> list as the fact table, count as
+        only the base-2 logarithm of <replaceable>N</replaceable>+1 (rounded
+        up) items, which is fewer than <replaceable>N</replaceable> only if
+        <replaceable>N</replaceable> is at least 3.
         Only inner joins of plain tables, with no other conditions or
         <literal>TABLESAMPLE</literal> clauses on the dimension tables, are
         optimized.  The default is <literal>on</literal>.
@@ -6731,7 +6738,9 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
         Use genetic query optimization to plan queries with at least
         this many <literal>FROM</literal> items involved. (Note that a
         <literal>FULL OUTER JOIN</literal> construct counts as only one <literal>FROM</literal>
-        item.) The default is 12. For simpler queries it is usually best
+        item, and dimension tables of star joins optimized by
+        <xref linkend="guc-enable-starjoin-ordering"/> count as fewer items.)
+        The default is 12. For simpler queries it is usually best
         to use the regular, exhaustive-search planner, but for queries with
         many tables the exhaustive search takes too long, often
         longer than the penalty of executing a suboptimal plan.  Thus,
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 7306fe1b9fc..fc750fdc49d 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -3916,6 +3916,10 @@ make_rel_from_joinlist(PlannerInfo *root, List *joinlist)
 		 * We put the initial_rels list into a PlannerInfo field because
 		 * has_legal_joinclause() and join_is_legal() need to look at it (ugly
 		 * :-().
+		 *
+		 * Dimensions of star joins count as fewer rels toward geqo_threshold,
+		 * because the standard join search considers only the canonical order
+		 * of joining them to the fact (see starjoin_geqo_levels).
 		 */
 		root->initial_rels = initial_rels;
 
@@ -3927,7 +3931,8 @@ make_rel_from_joinlist(PlannerInfo *root, List *joinlist)
 
 		if (join_search_hook)
 			return (*join_search_hook) (root, levels_needed, initial_rels);
-		else if (enable_geqo && levels_needed >= geqo_threshold)
+		else if (enable_geqo &&
+				 starjoin_geqo_levels(root, levels_needed) >= geqo_threshold)
 			return geqo(root, levels_needed, initial_rels);
 		else
 			return standard_join_search(root, levels_needed, initial_rels);
diff --git a/src/backend/optimizer/path/joinrels.c b/src/backend/optimizer/path/joinrels.c
index 9231093493a..53c0163af97 100644
--- a/src/backend/optimizer/path/joinrels.c
+++ b/src/backend/optimizer/path/joinrels.c
@@ -22,6 +22,7 @@
 #include "optimizer/paths.h"
 #include "optimizer/planner.h"
 #include "partitioning/partbounds.h"
+#include "port/pg_bitutils.h"
 #include "utils/memutils.h"
 
 
@@ -2328,7 +2329,8 @@ starjoin_order_invalid(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2)
 		 * joins of join_search_one_level.  For each set of the other rels,
 		 * the search then builds at most d+1 joinrels without the fact (with
 		 * no dimension, or with one of the d dimensions), just like with the
-		 * fact.
+		 * fact, which is consistent with how the dimensions count toward
+		 * geqo_threshold (see starjoin_geqo_levels).
 		 *
 		 * Outside the last-ditch pass, join_search_one_level joins a
 		 * dimension to a rel without the fact only if that rel has no join
@@ -2399,3 +2401,36 @@ starjoin_order_invalid(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2)
 
 	return violates;
 }
+
+/*
+ * starjoin_geqo_levels
+ *		Return the number of initial rels of the current join search
+ *		subproblem to count toward geqo_threshold.
+ *
+ * The standard join search joins the dimensions of a starjoin cluster to the
+ * fact only in the canonical order (see starjoin_order_invalid), so it
+ * considers only d+1 of the 2^d subsets of the d dimensions.  So the
+ * dimensions count as only ceil(log2(d+1)) rels.  We can't ignore them
+ * entirely, as each cluster still multiplies the number of join rels by d+1.
+ * With multiple clusters, or with many other rels, the standard join search
+ * might get much more expensive than GEQO.
+ *
+ * The dimensions are those starjoin_setup_subproblem determined for the
+ * subproblem.  A cluster has none if its fact is not part of the subproblem,
+ * as the order is not enforced without the fact.
+ */
+int
+starjoin_geqo_levels(PlannerInfo *root, int levels_needed)
+{
+	ListCell   *lc;
+
+	foreach(lc, root->starjoin_clusters)
+	{
+		StarJoinClusterInfo *c = (StarJoinClusterInfo *) lfirst(lc);
+		int			ndims = bms_num_members(c->subproblem_dims);
+
+		levels_needed -= ndims - (int) pg_ceil_log2_32(ndims + 1);
+	}
+
+	return levels_needed;
+}
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index 061b5b05232..6a3f15b8a51 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -121,6 +121,7 @@ extern void mark_dummy_rel(RelOptInfo *rel);
 extern void init_dummy_sjinfo(SpecialJoinInfo *sjinfo, Relids left_relids,
 							  Relids right_relids);
 extern void starjoin_setup_subproblem(PlannerInfo *root);
+extern int	starjoin_geqo_levels(PlannerInfo *root, int levels_needed);
 
 /*
  * equivclass.c
diff --git a/src/test/regress/expected/starjoin_geqo.out b/src/test/regress/expected/starjoin_geqo.out
index 5e0369616cd..ce3ee61a8e8 100644
--- a/src/test/regress/expected/starjoin_geqo.out
+++ b/src/test/regress/expected/starjoin_geqo.out
@@ -3,11 +3,12 @@
 --
 -- The standard join search joins the dimensions of a star to the fact only
 -- in the canonical order, so it considers only d+1 of the 2^d subsets of the
--- d dimensions.  But a star with more rels than geqo_threshold is planned by
--- GEQO, even though the standard join search would be much cheaper.  And the
--- pruning does not make GEQO any cheaper, because GEQO evaluates a fixed
--- number of join orders, each joining all the rels.  Checking the canonical
--- order only adds overhead.
+-- d dimensions.  So the dimensions count as only ceil(log2(d+1)) rels toward
+-- geqo_threshold, and a star gets planned by the standard join search even
+-- if it has more rels than geqo_threshold.  With enough other rels GEQO is
+-- still used, and the pruning does not make it any cheaper, because GEQO
+-- evaluates a fixed number of join orders, each joining all the rels.
+-- Checking the canonical order only adds overhead.
 --
 -- Each check is a single boolean, phrased as the desired behavior.  EXPLAIN
 -- does not show whether a query was planned by GEQO, so the checks detect
@@ -87,8 +88,9 @@ VACUUM ANALYZE starjoin_geqo_a, starjoin_geqo_c1, starjoin_geqo_d1,
 -- Star with explicit joins
 --
 -- With join_collapse_limit = 20 the star with 10 dimensions (11 rels) is a
--- single subproblem, above geqo_threshold = 8, so it's planned by GEQO,
--- which joins the dimensions in the canonical order too.
+-- single subproblem, above geqo_threshold = 8.  But the dimensions count as
+-- only 4 rels, so the star is planned by the standard join search, which
+-- joins the dimensions in the canonical order.
 --
 SELECT $$
 SELECT count(*) FROM starjoin_geqo_f AS f
@@ -108,13 +110,59 @@ SET join_collapse_limit = 1;
 SELECT starjoin_geqo_plan(:'q_star', true) AS plan_canonical \gset
 SET join_collapse_limit = 20;
 SET geqo_threshold = 8;
--- GEQO uses the canonical order
-SELECT starjoin_geqo_plan(:'q_star', true) = :'plan_canonical' AS geqo_plan_canonical;
- geqo_plan_canonical 
+-- the star is planned by the standard join search, not by GEQO
+SELECT NOT starjoin_geqo_used(:'q_star', true) AS star_standard_search;
+ star_standard_search 
+----------------------
+ t
+(1 row)
+
+-- the standard join search uses the canonical order
+SELECT starjoin_geqo_plan(:'q_star', true) = :'plan_canonical' AS star_plan_canonical;
+ star_plan_canonical 
 ---------------------
  t
 (1 row)
 
+-- An additional join clause excludes d10 from the cluster.  The other nine
+-- dimensions count as four rels, so with f and d10 the count is six.
+SET geqo_threshold = 6;
+SELECT starjoin_geqo_used(:'q_star' || ' AND f.id > d10.v', true)
+       AS selective_dimension_geqo;
+ selective_dimension_geqo 
+--------------------------
+ t
+(1 row)
+
+-- Sampling d10 also excludes it from the cluster, giving the same count.
+SELECT starjoin_geqo_used(
+         replace(:'q_star', 'starjoin_geqo_d10 AS d10',
+                 'starjoin_geqo_d10 AS d10 TABLESAMPLE BERNOULLI (10)'), true)
+       AS bernoulli_dimension_geqo;
+ bernoulli_dimension_geqo 
+--------------------------
+ t
+(1 row)
+
+SELECT starjoin_geqo_used(
+         replace(:'q_star', 'starjoin_geqo_d10 AS d10',
+                 'starjoin_geqo_d10 AS d10 TABLESAMPLE SYSTEM (10)'), true)
+       AS system_dimension_geqo;
+ system_dimension_geqo 
+-----------------------
+ t
+(1 row)
+
+-- Sampling the fact does not disqualify its unsampled dimensions.
+SELECT NOT starjoin_geqo_used(
+         replace(:'q_star', 'starjoin_geqo_f AS f',
+                 'starjoin_geqo_f AS f TABLESAMPLE BERNOULLI (10)'), true)
+       AS sampled_fact_standard_search;
+ sampled_fact_standard_search 
+------------------------------
+ t
+(1 row)
+
 RESET geqo_threshold;
 RESET join_collapse_limit;
 --
@@ -122,8 +170,10 @@ RESET join_collapse_limit;
 --
 -- A FROM list of tables is never split into subproblems (join_collapse_limit
 -- applies to explicit joins, from_collapse_limit to subqueries), so with the
--- default settings a star with 11 dimensions (12 rels) is planned by GEQO,
--- and it's pruned too.
+-- default settings a star with 11 dimensions (12 rels) would be planned by
+-- GEQO.  But the dimensions count as only 4 rels, so the star is planned by
+-- the standard join search.  With enough other rels GEQO is still used, and
+-- it's pruned too.
 --
 SELECT $$
 SELECT count(*)
@@ -158,16 +208,22 @@ SELECT starjoin_geqo_used(:'q_star_list', false) AS star_list_geqo_off;
  t
 (1 row)
 
--- XXX the dimensions count towards geqo_threshold
+-- the dimensions count as fewer rels toward geqo_threshold
 SELECT NOT starjoin_geqo_used(:'q_star_list', true) AS star_list_standard_search;
  star_list_standard_search 
 ---------------------------
- f
+ t
+(1 row)
+
+-- the 11 dimensions count as 4 rels, so with f and c1 the star counts as 6
+SET geqo_threshold = 7;
+SELECT NOT starjoin_geqo_used(:'q_star_list_c1', true) AS star_list_c1_standard_search;
+ star_list_c1_standard_search 
+------------------------------
+ t
 (1 row)
 
--- the star with c1 has two rels other than the dimensions, so with
--- geqo_threshold = 2 it's planned by GEQO
-SET geqo_threshold = 2;
+SET geqo_threshold = 6;
 SELECT starjoin_geqo_used(:'q_star_list_c1', true) AS star_list_c1_geqo;
  star_list_c1_geqo 
 -------------------
diff --git a/src/test/regress/sql/starjoin_geqo.sql b/src/test/regress/sql/starjoin_geqo.sql
index e815f48b142..4f004472bfc 100644
--- a/src/test/regress/sql/starjoin_geqo.sql
+++ b/src/test/regress/sql/starjoin_geqo.sql
@@ -3,11 +3,12 @@
 --
 -- The standard join search joins the dimensions of a star to the fact only
 -- in the canonical order, so it considers only d+1 of the 2^d subsets of the
--- d dimensions.  But a star with more rels than geqo_threshold is planned by
--- GEQO, even though the standard join search would be much cheaper.  And the
--- pruning does not make GEQO any cheaper, because GEQO evaluates a fixed
--- number of join orders, each joining all the rels.  Checking the canonical
--- order only adds overhead.
+-- d dimensions.  So the dimensions count as only ceil(log2(d+1)) rels toward
+-- geqo_threshold, and a star gets planned by the standard join search even
+-- if it has more rels than geqo_threshold.  With enough other rels GEQO is
+-- still used, and the pruning does not make it any cheaper, because GEQO
+-- evaluates a fixed number of join orders, each joining all the rels.
+-- Checking the canonical order only adds overhead.
 --
 -- Each check is a single boolean, phrased as the desired behavior.  EXPLAIN
 -- does not show whether a query was planned by GEQO, so the checks detect
@@ -98,8 +99,9 @@ VACUUM ANALYZE starjoin_geqo_a, starjoin_geqo_c1, starjoin_geqo_d1,
 -- Star with explicit joins
 --
 -- With join_collapse_limit = 20 the star with 10 dimensions (11 rels) is a
--- single subproblem, above geqo_threshold = 8, so it's planned by GEQO,
--- which joins the dimensions in the canonical order too.
+-- single subproblem, above geqo_threshold = 8.  But the dimensions count as
+-- only 4 rels, so the star is planned by the standard join search, which
+-- joins the dimensions in the canonical order.
 --
 SELECT $$
 SELECT count(*) FROM starjoin_geqo_f AS f
@@ -121,8 +123,32 @@ SELECT starjoin_geqo_plan(:'q_star', true) AS plan_canonical \gset
 
 SET join_collapse_limit = 20;
 SET geqo_threshold = 8;
--- GEQO uses the canonical order
-SELECT starjoin_geqo_plan(:'q_star', true) = :'plan_canonical' AS geqo_plan_canonical;
+-- the star is planned by the standard join search, not by GEQO
+SELECT NOT starjoin_geqo_used(:'q_star', true) AS star_standard_search;
+-- the standard join search uses the canonical order
+SELECT starjoin_geqo_plan(:'q_star', true) = :'plan_canonical' AS star_plan_canonical;
+
+-- An additional join clause excludes d10 from the cluster.  The other nine
+-- dimensions count as four rels, so with f and d10 the count is six.
+SET geqo_threshold = 6;
+SELECT starjoin_geqo_used(:'q_star' || ' AND f.id > d10.v', true)
+       AS selective_dimension_geqo;
+
+-- Sampling d10 also excludes it from the cluster, giving the same count.
+SELECT starjoin_geqo_used(
+         replace(:'q_star', 'starjoin_geqo_d10 AS d10',
+                 'starjoin_geqo_d10 AS d10 TABLESAMPLE BERNOULLI (10)'), true)
+       AS bernoulli_dimension_geqo;
+SELECT starjoin_geqo_used(
+         replace(:'q_star', 'starjoin_geqo_d10 AS d10',
+                 'starjoin_geqo_d10 AS d10 TABLESAMPLE SYSTEM (10)'), true)
+       AS system_dimension_geqo;
+
+-- Sampling the fact does not disqualify its unsampled dimensions.
+SELECT NOT starjoin_geqo_used(
+         replace(:'q_star', 'starjoin_geqo_f AS f',
+                 'starjoin_geqo_f AS f TABLESAMPLE BERNOULLI (10)'), true)
+       AS sampled_fact_standard_search;
 RESET geqo_threshold;
 RESET join_collapse_limit;
 
@@ -131,8 +157,10 @@ RESET join_collapse_limit;
 --
 -- A FROM list of tables is never split into subproblems (join_collapse_limit
 -- applies to explicit joins, from_collapse_limit to subqueries), so with the
--- default settings a star with 11 dimensions (12 rels) is planned by GEQO,
--- and it's pruned too.
+-- default settings a star with 11 dimensions (12 rels) would be planned by
+-- GEQO.  But the dimensions count as only 4 rels, so the star is planned by
+-- the standard join search.  With enough other rels GEQO is still used, and
+-- it's pruned too.
 --
 SELECT $$
 SELECT count(*)
@@ -164,12 +192,13 @@ $$ AS q_star_list_c1 \gset
 
 -- with the GUC disabled, GEQO is used as usual
 SELECT starjoin_geqo_used(:'q_star_list', false) AS star_list_geqo_off;
--- XXX the dimensions count towards geqo_threshold
+-- the dimensions count as fewer rels toward geqo_threshold
 SELECT NOT starjoin_geqo_used(:'q_star_list', true) AS star_list_standard_search;
 
--- the star with c1 has two rels other than the dimensions, so with
--- geqo_threshold = 2 it's planned by GEQO
-SET geqo_threshold = 2;
+-- the 11 dimensions count as 4 rels, so with f and c1 the star counts as 6
+SET geqo_threshold = 7;
+SELECT NOT starjoin_geqo_used(:'q_star_list_c1', true) AS star_list_c1_standard_search;
+SET geqo_threshold = 6;
 SELECT starjoin_geqo_used(:'q_star_list_c1', true) AS star_list_c1_geqo;
 -- XXX GEQO is pruned too, so the GUC changes the plan
 SELECT starjoin_geqo_plan(:'q_star_list_c1', true)
-- 
2.56.1

