@@ -11,7 +11,7 @@ index bbf220407b..8225105893 100644
11
11
auth_delay \
12
12
auto_explain \
13
13
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
14
- index f86983c660..452633ab0e 100644
14
+ index a0311ce9dc..a4fa160d5a 100644
15
15
--- a/src/backend/commands/explain.c
16
16
+++ b/src/backend/commands/explain.c
17
17
@@ -24,6 +24,7 @@
@@ -35,7 +35,7 @@ index f86983c660..452633ab0e 100644
35
35
36
36
/* OR-able flags for ExplainXMLTag() */
37
37
#define X_OPENING 0
38
- @@ -676 ,6 +683 ,10 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
38
+ @@ -660 ,6 +667 ,10 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
39
39
ExplainPropertyFloat("Execution Time", "ms", 1000.0 * totaltime, 3,
40
40
es);
41
41
@@ -57,7 +57,7 @@ index f86983c660..452633ab0e 100644
57
57
if (es->format == EXPLAIN_FORMAT_TEXT)
58
58
appendStringInfoChar(es->str, '\n');
59
59
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
60
- index 89d3c4352c..611f320446 100644
60
+ index 29ae32d960..d009b161da 100644
61
61
--- a/src/backend/optimizer/path/costsize.c
62
62
+++ b/src/backend/optimizer/path/costsize.c
63
63
@@ -99,6 +99,11 @@
@@ -322,7 +322,7 @@ index 89d3c4352c..611f320446 100644
322
322
{
323
323
double parallel_divisor = path->parallel_workers;
324
324
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
325
- index 66139928e8..ae8eaff77e 100644
325
+ index cd68942af0..ab782b47ab 100644
326
326
--- a/src/backend/optimizer/plan/createplan.c
327
327
+++ b/src/backend/optimizer/plan/createplan.c
328
328
@@ -70,6 +70,7 @@
@@ -353,7 +353,7 @@ index 66139928e8..ae8eaff77e 100644
353
353
354
354
/*
355
355
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
356
- index e21e72eb87..3ed0c5c1d2 100644
356
+ index 05f44faf6e..082e47332d 100644
357
357
--- a/src/backend/optimizer/plan/planner.c
358
358
+++ b/src/backend/optimizer/plan/planner.c
359
359
@@ -145,7 +145,8 @@ static List *extract_rollup_sets(List *groupingSets);
@@ -366,7 +366,7 @@ index e21e72eb87..3ed0c5c1d2 100644
366
366
grouping_sets_data *gd,
367
367
List *target_list);
368
368
static RelOptInfo *create_grouping_paths(PlannerInfo *root,
369
- @@ -3443 ,7 +3444 ,8 @@ standard_qp_callback(PlannerInfo *root, void *extra)
369
+ @@ -3544 ,7 +3545 ,8 @@ standard_qp_callback(PlannerInfo *root, void *extra)
370
370
*/
371
371
static double
372
372
get_number_of_groups(PlannerInfo *root,
@@ -376,7 +376,7 @@ index e21e72eb87..3ed0c5c1d2 100644
376
376
grouping_sets_data *gd,
377
377
List *target_list)
378
378
{
379
- @@ -3480 ,7 +3482 ,7 @@ get_number_of_groups(PlannerInfo *root,
379
+ @@ -3581 ,7 +3583 ,7 @@ get_number_of_groups(PlannerInfo *root,
380
380
GroupingSetData *gs = lfirst_node(GroupingSetData, lc3);
381
381
double numGroups = estimate_num_groups(root,
382
382
groupExprs,
@@ -385,7 +385,7 @@ index e21e72eb87..3ed0c5c1d2 100644
385
385
&gset,
386
386
NULL);
387
387
388
- @@ -3506 ,7 +3508 ,7 @@ get_number_of_groups(PlannerInfo *root,
388
+ @@ -3607 ,7 +3609 ,7 @@ get_number_of_groups(PlannerInfo *root,
389
389
GroupingSetData *gs = lfirst_node(GroupingSetData, lc2);
390
390
double numGroups = estimate_num_groups(root,
391
391
groupExprs,
@@ -394,8 +394,8 @@ index e21e72eb87..3ed0c5c1d2 100644
394
394
&gset,
395
395
NULL);
396
396
397
- @@ -3523 ,8 +3525 ,8 @@ get_number_of_groups(PlannerInfo *root,
398
- groupExprs = get_sortgrouplist_exprs(parse->groupClause ,
397
+ @@ -3624 ,8 +3626 ,8 @@ get_number_of_groups(PlannerInfo *root,
398
+ groupExprs = get_sortgrouplist_exprs(root->processed_groupClause ,
399
399
target_list);
400
400
401
401
- dNumGroups = estimate_num_groups(root, groupExprs, path_rows,
@@ -405,7 +405,7 @@ index e21e72eb87..3ed0c5c1d2 100644
405
405
}
406
406
}
407
407
else if (parse->groupingSets)
408
- @@ -3911 ,7 +3913 ,8 @@ create_ordinary_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel,
408
+ @@ -4015 ,7 +4017 ,8 @@ create_ordinary_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel,
409
409
* Estimate number of groups.
410
410
*/
411
411
dNumGroups = get_number_of_groups(root,
@@ -415,7 +415,7 @@ index e21e72eb87..3ed0c5c1d2 100644
415
415
gd,
416
416
extra->targetList);
417
417
418
- @@ -6823 ,13 +6826 ,15 @@ create_partial_grouping_paths(PlannerInfo *root,
418
+ @@ -7115 ,13 +7118 ,15 @@ create_partial_grouping_paths(PlannerInfo *root,
419
419
if (cheapest_total_path != NULL)
420
420
dNumPartialGroups =
421
421
get_number_of_groups(root,
@@ -434,7 +434,7 @@ index e21e72eb87..3ed0c5c1d2 100644
434
434
extra->targetList);
435
435
436
436
diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c
437
- index 7085cf3c41..6fcbea2a8e 100644
437
+ index 18b92336be..d56fd933d8 100644
438
438
--- a/src/backend/optimizer/util/relnode.c
439
439
+++ b/src/backend/optimizer/util/relnode.c
440
440
@@ -265,6 +265,7 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptInfo *parent)
@@ -453,31 +453,31 @@ index 7085cf3c41..6fcbea2a8e 100644
453
453
elog(ERROR, "no relation entry for relid %d", relid);
454
454
455
455
return NULL; /* keep compiler quiet */
456
- @@ -680 ,6 +680 ,7 @@ build_join_rel(PlannerInfo *root,
456
+ @@ -679 ,6 +679 ,7 @@ build_join_rel(PlannerInfo *root,
457
457
joinrel->all_partrels = NULL;
458
458
joinrel->partexprs = NULL;
459
459
joinrel->nullable_partexprs = NULL;
460
460
+ joinrel->ext_nodes = NULL;
461
461
462
462
/* Compute information relevant to the foreign relations. */
463
463
set_foreign_rel_properties(joinrel, outer_rel, inner_rel);
464
- @@ -862 ,6 +863 ,7 @@ build_child_join_rel(PlannerInfo *root, RelOptInfo *outer_rel,
464
+ @@ -858 ,6 +859 ,7 @@ build_child_join_rel(PlannerInfo *root, RelOptInfo *outer_rel,
465
465
joinrel->all_partrels = NULL;
466
466
joinrel->partexprs = NULL;
467
467
joinrel->nullable_partexprs = NULL;
468
468
+ joinrel->ext_nodes = NULL;
469
469
470
470
/* Compute information relevant to foreign relations. */
471
471
set_foreign_rel_properties(joinrel, outer_rel, inner_rel);
472
- @@ -1302 ,6 +1304 ,7 @@ find_childrel_parents(PlannerInfo *root, RelOptInfo *rel)
472
+ @@ -1298 ,6 +1300 ,7 @@ find_childrel_parents(PlannerInfo *root, RelOptInfo *rel)
473
473
}
474
474
475
475
476
476
+ set_parampathinfo_postinit_hook_type parampathinfo_postinit_hook = NULL;
477
477
/*
478
478
* get_baserel_parampathinfo
479
479
* Get the ParamPathInfo for a parameterized path for a base relation,
480
- @@ -1370 ,6 +1373 ,10 @@ get_baserel_parampathinfo(PlannerInfo *root, RelOptInfo *baserel,
480
+ @@ -1366 ,6 +1369 ,10 @@ get_baserel_parampathinfo(PlannerInfo *root, RelOptInfo *baserel,
481
481
ppi->ppi_req_outer = required_outer;
482
482
ppi->ppi_rows = rows;
483
483
ppi->ppi_clauses = pclauses;
@@ -488,7 +488,7 @@ index 7085cf3c41..6fcbea2a8e 100644
488
488
baserel->ppilist = lappend(baserel->ppilist, ppi);
489
489
490
490
return ppi;
491
- @@ -1595 ,6 +1602 ,10 @@ get_joinrel_parampathinfo(PlannerInfo *root, RelOptInfo *joinrel,
491
+ @@ -1591 ,6 +1598 ,10 @@ get_joinrel_parampathinfo(PlannerInfo *root, RelOptInfo *joinrel,
492
492
ppi->ppi_req_outer = required_outer;
493
493
ppi->ppi_rows = rows;
494
494
ppi->ppi_clauses = NIL;
@@ -500,18 +500,18 @@ index 7085cf3c41..6fcbea2a8e 100644
500
500
501
501
return ppi;
502
502
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
503
- index 48858a871a..a6615c5210 100644
503
+ index 4e4888dde4..5b22f65012 100644
504
504
--- a/src/backend/utils/adt/selfuncs.c
505
505
+++ b/src/backend/utils/adt/selfuncs.c
506
- @@ -144 ,6 +144 ,7 @@
506
+ @@ -145 ,6 +145 ,7 @@
507
507
/* Hooks for plugins to get control when we ask for stats */
508
508
get_relation_stats_hook_type get_relation_stats_hook = NULL;
509
509
get_index_stats_hook_type get_index_stats_hook = NULL;
510
510
+ estimate_num_groups_hook_type estimate_num_groups_hook = NULL;
511
511
512
512
static double eqsel_internal(PG_FUNCTION_ARGS, bool negate);
513
513
static double eqjoinsel_inner(Oid opfuncoid, Oid collation,
514
- @@ -3310 ,6 +3311 ,20 @@ add_unique_group_var(PlannerInfo *root, List *varinfos,
514
+ @@ -3311 ,6 +3312 ,20 @@ add_unique_group_var(PlannerInfo *root, List *varinfos,
515
515
return varinfos;
516
516
}
517
517
@@ -533,7 +533,7 @@ index 48858a871a..a6615c5210 100644
533
533
* estimate_num_groups - Estimate number of groups in a grouped query
534
534
*
535
535
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h
536
- index 9ebde089ae..1519e3e6b7 100644
536
+ index 7c1071ddd1..72e954dd3e 100644
537
537
--- a/src/include/commands/explain.h
538
538
+++ b/src/include/commands/explain.h
539
539
@@ -75,6 +75,18 @@ extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
@@ -556,10 +556,10 @@ index 9ebde089ae..1519e3e6b7 100644
556
556
extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
557
557
ParamListInfo params, DestReceiver *dest);
558
558
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h
559
- index 654dba61aa..c0ac86b1bc 100644
559
+ index 2d1d8f4bcd..48d60559f5 100644
560
560
--- a/src/include/nodes/pathnodes.h
561
561
+++ b/src/include/nodes/pathnodes.h
562
- @@ -997 ,6 +997 ,16 @@ typedef struct RelOptInfo
562
+ @@ -1025 ,6 +1025 ,16 @@ typedef struct RelOptInfo
563
563
List **partexprs pg_node_attr(read_write_ignore);
564
564
/* Nullable partition key expressions */
565
565
List **nullable_partexprs pg_node_attr(read_write_ignore);
@@ -576,7 +576,7 @@ index 654dba61aa..c0ac86b1bc 100644
576
576
} RelOptInfo;
577
577
578
578
/*
579
- @@ -1467 ,6 +1477 ,10 @@ typedef struct ParamPathInfo
579
+ @@ -1495 ,6 +1505 ,10 @@ typedef struct ParamPathInfo
580
580
Relids ppi_req_outer; /* rels supplying parameters used by path */
581
581
Cardinality ppi_rows; /* estimated number of result tuples */
582
582
List *ppi_clauses; /* join clauses available from outer rels */
@@ -588,7 +588,7 @@ index 654dba61aa..c0ac86b1bc 100644
588
588
589
589
590
590
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
591
- index bddfe86191..bedda73792 100644
591
+ index c1234fcf36..8c77da84aa 100644
592
592
--- a/src/include/nodes/plannodes.h
593
593
+++ b/src/include/nodes/plannodes.h
594
594
@@ -173,6 +173,9 @@ typedef struct Plan
@@ -602,7 +602,7 @@ index bddfe86191..bedda73792 100644
602
602
603
603
/* ----------------
604
604
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
605
- index b6cc2c9cd6..ce8de270e8 100644
605
+ index 6cf49705d3..6a96baf130 100644
606
606
--- a/src/include/optimizer/cost.h
607
607
+++ b/src/include/optimizer/cost.h
608
608
@@ -41,6 +41,37 @@ typedef enum
@@ -686,7 +686,7 @@ index b6cc2c9cd6..ce8de270e8 100644
686
686
687
687
#endif /* COST_H */
688
688
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h
689
- index 050f00e79a..15a1970744 100644
689
+ index 02305ef902..5226ddc8e8 100644
690
690
--- a/src/include/optimizer/pathnode.h
691
691
+++ b/src/include/optimizer/pathnode.h
692
692
@@ -18,6 +18,10 @@
@@ -701,7 +701,7 @@ index 050f00e79a..15a1970744 100644
701
701
* prototypes for pathnode.c
702
702
*/
703
703
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
704
- index 9dffdcfd1e..78d58b7d45 100644
704
+ index 95ecefdade..a732d24fb6 100644
705
705
--- a/src/include/optimizer/planmain.h
706
706
+++ b/src/include/optimizer/planmain.h
707
707
@@ -24,6 +24,12 @@ extern PGDLLIMPORT double cursor_tuple_fraction;
@@ -718,7 +718,7 @@ index 9dffdcfd1e..78d58b7d45 100644
718
718
* prototypes for plan/planmain.c
719
719
*/
720
720
diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h
721
- index 8f3d73edfb..91537e2325 100644
721
+ index 2f76c473db..98b9a95d0f 100644
722
722
--- a/src/include/utils/selfuncs.h
723
723
+++ b/src/include/utils/selfuncs.h
724
724
@@ -144,6 +144,13 @@ typedef bool (*get_index_stats_hook_type) (PlannerInfo *root,
0 commit comments