Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1c5fff8

Browse files
committed
Draft
1 parent 2569512 commit 1c5fff8

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

cardinality_hooks.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ predict_num_groups(PlannerInfo *root, Path *subpath, List *group_exprs,
406406
return (prediction <= 0) ? -1 : prediction;
407407
}
408408

409-
double
410-
aqo_estimate_num_groups_hook(PlannerInfo *root, List *groupExprs,
411-
Path *subpath, RelOptInfo *grouped_rel,
412-
List **pgset)
409+
static double
410+
aqo_estimate_num_groups(PlannerInfo *root, List *groupExprs,
411+
Path *subpath, RelOptInfo *grouped_rel,
412+
List **pgset)
413413
{
414414
int fss;
415415
double predicted;
@@ -422,12 +422,8 @@ aqo_estimate_num_groups_hook(PlannerInfo *root, List *groupExprs,
422422
/* XXX: Don't support some GROUPING options */
423423
goto default_estimator;
424424

425-
/* Zero the estinfo output parameter, if non-NULL */
426-
if (estinfo != NULL)
427-
memset(estinfo, 0, sizeof(EstimationInfo));
428-
429425
if (aqo_estimate_num_groups_next != NULL ||
430-
estimate_num_groups_hook != aqo_estimate_num_groups)
426+
estimate_num_groups_hook != aqo_estimate_num_groups_next)
431427
/* It is unclear that to do in situation of such kind. Just report it */
432428
elog(WARNING, "AQO is in the middle of the estimate_num_groups_hook chain");
433429

@@ -457,10 +453,10 @@ aqo_estimate_num_groups_hook(PlannerInfo *root, List *groupExprs,
457453
default_estimator:
458454
if (aqo_estimate_num_groups_next)
459455
return (*aqo_estimate_num_groups_next)(root, groupExprs, subpath,
460-
grouped_rel, pgset, estinfo);
456+
grouped_rel, pgset);
461457
else
462458
return estimate_num_groups(root, groupExprs, subpath->rows,
463-
pgset, estinfo);
459+
pgset);
464460
}
465461

466462
void

preprocessing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static bool isQueryUsingSystemRelation_walker(Node *node, void *context);
8383
static bool
8484
aqoIsEnabled(Query *parse)
8585
{
86-
if (creating_extension || !IsQueryIdEnabled() ||
86+
if (creating_extension ||
8787
(aqo_mode == AQO_MODE_DISABLED && !force_collect_stat) ||
8888
(parse->commandType != CMD_SELECT && parse->commandType != CMD_INSERT &&
8989
parse->commandType != CMD_UPDATE && parse->commandType != CMD_DELETE))

0 commit comments

Comments
 (0)