char *plan_name,
pgpa_join_state *pjs);
static void pgpa_planner_apply_join_path_advice(JoinType jointype,
- uint64 *pgs_mask_p,
- char *plan_name,
- pgpa_join_state *pjs);
+ uint64 *pgs_mask_p,
+ char *plan_name,
+ pgpa_join_state *pjs);
static void pgpa_planner_apply_scan_advice(RelOptInfo *rel,
pgpa_trove_entry *entries,
Bitmapset *indexes);
pps = GetPlannerGlobalExtensionState(root->glob, planner_extension_id);
/*
- * The default behavior of propagating the path generation strategy
- * mask from parents to children is unsuitable for us.
+ * The default behavior of propagating the path generation strategy mask
+ * from parents to children is unsuitable for us.
*
* XXX. Maybe that behavior should be rethought.
*/
Assert(bms_membership(joinrel->relids) == BMS_MULTIPLE);
/*
- * The default behavior of propagating the path generation strategy
- * mask from parents to children is unsuitable for us.
+ * The default behavior of propagating the path generation strategy mask
+ * from parents to children is unsuitable for us.
*
* XXX. Maybe that behavior should be rethought.
*/
* Carry out whatever work we want to do after planning is complete.
*/
static void
-pgpa_planner_shutdown(PlannerGlobal *glob, Query *parse, const char *query_string,
- PlannedStmt *pstmt)
+pgpa_planner_shutdown(PlannerGlobal *glob, Query *parse,
+ const char *query_string, PlannedStmt *pstmt)
{
pgpa_planner_state *pps;
pgpa_tkm_type tkm;
/*
- * The NO_GATHER tag is applied to single relations and applies
- * to every joinrel that contains them, and the advice trove should
- * only return entries that overlap with this joinrel. Therefore,
- * this entry is certainly relevant to this joinrel, and we should
- * not allow a Gather or Gather Merge here.
+ * The NO_GATHER tag is applied to single relations and applies to
+ * every joinrel that contains them, and the advice trove should only
+ * return entries that overlap with this joinrel. Therefore, this
+ * entry is certainly relevant to this joinrel, and we should not
+ * allow a Gather or Gather Merge here.
*/
if (entry->tag == PGPA_TAG_NO_GATHER)
{
Assert(tkm != PGPA_TKM_DISJOINT);
/*
- * If it matches exactly, then do the advice says. If it doesn't,
- * then don't do whatever the advice says, because it must happen at
+ * If it matches exactly, then do the advice says. If it doesn't, then
+ * don't do whatever the advice says, because it must happen at
* whatever joinrel matches exactly, and that's not this one.
*/
if (tkm == PGPA_TKM_EQUAL)
*pgs_mask_p &= ~(PGS_APPEND | PGS_MERGE_APPEND);
/*
- * To force Gather or Gather Merge, we must disable the other one, plus
- * we must also disable non-partial paths. To force a non-Gather-based
- * plan, we disable both Gather and Gather Merge.
+ * To force Gather or Gather Merge, we must disable the other one, plus we
+ * must also disable non-partial paths. To force a non-Gather-based plan,
+ * we disable both Gather and Gather Merge.
*/
if (force_gather)
*pgs_mask_p &= ~(PGS_GATHER_MERGE | PGS_CONSIDER_NONPARTIAL);
my_scan_type = PGS_SEQSCAN;
else if (my_entry->tag == PGPA_TAG_PARTITIONWISE)
{
- bool just_one_rel;
+ bool just_one_rel;
/*
- * XXX. Is this really correct? It's true that if the user wants
- * a PARTITIONWISE scan of just this relation, then we should
- * force Append or MergeAppend here, but does it really mattter
- * what we do otherwise?
+ * XXX. Is this really correct? It's true that if the user wants a
+ * PARTITIONWISE scan of just this relation, then we should force
+ * Append or MergeAppend here, but does it really mattter what we
+ * do otherwise?
*/
just_one_rel = my_entry->target->ttype == PGPA_TARGET_IDENTIFIER
|| list_length(my_entry->target->children) == 1;
else if (my_entry->tag == PGPA_TAG_GATHER |
my_entry->tag == PGPA_TAG_GATHER_MERGE)
{
- bool just_one_rel;
+ bool just_one_rel;
/*
* If GATHER or GATHER_MERGE is applied to a single identifier or
- * a list of length 1, then we should force it here. Otherwise,
- * we should prevent it here, and force it at the level of the
+ * a list of length 1, then we should force it here. Otherwise, we
+ * should prevent it here, and force it at the level of the
* joinrel that exactly matches the list of targets.
*/
just_one_rel = my_entry->target->ttype == PGPA_TARGET_IDENTIFIER
/* Enforce choice of index. */
if (scan_entry != NULL && (scan_entry->tag == PGPA_TAG_INDEX_SCAN ||
- scan_entry->tag == PGPA_TAG_INDEX_ONLY_SCAN))
+ scan_entry->tag == PGPA_TAG_INDEX_ONLY_SCAN))
{
pgpa_index_target *itarget = scan_entry->target->itarget;
IndexOptInfo *matched_index = NULL;
if (scan_type != 0)
{
rel->pgs_mask &=
- ~(PGS_SCAN_ANY|PGS_APPEND|PGS_MERGE_APPEND|PGS_CONSIDER_INDEXONLY);
+ ~(PGS_SCAN_ANY | PGS_APPEND | PGS_MERGE_APPEND | PGS_CONSIDER_INDEXONLY);
rel->pgs_mask |= scan_type;
}
if (gather_mask != 0)
{
rel->pgs_mask &=
- ~(PGS_GATHER|PGS_GATHER_MERGE|PGS_CONSIDER_NONPARTIAL);
+ ~(PGS_GATHER | PGS_GATHER_MERGE | PGS_CONSIDER_NONPARTIAL);
rel->pgs_mask |= gather_mask;
}