aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/pathnode.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-06-21 15:18:54 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-06-21 15:19:25 -0400
commitc7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch)
treee85979fb1213a731b7b557f8a830df541f26b135 /src/backend/optimizer/util/pathnode.c
parentf669c09989bda894d6ba01634ccb229f0687c08a (diff)
downloadpostgresql-c7b8998ebbf310a156aa38022555a24d98fdbfb4.tar.gz
postgresql-c7b8998ebbf310a156aa38022555a24d98fdbfb4.zip
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r--src/backend/optimizer/util/pathnode.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index ec4a093d9fb..63afc04b625 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -411,7 +411,7 @@ set_cheapest(RelOptInfo *parent_rel)
void
add_path(RelOptInfo *parent_rel, Path *new_path)
{
- bool accept_new = true; /* unless we find a superior old path */
+ bool accept_new = true; /* unless we find a superior old path */
ListCell *insert_after = NULL; /* where to insert new item */
List *new_path_pathkeys;
ListCell *p1;
@@ -484,7 +484,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET1) &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
}
else if (keyscmp == PATHKEYS_BETTER2)
{
@@ -492,7 +492,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET2) &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
}
else /* keyscmp == PATHKEYS_EQUAL */
{
@@ -534,11 +534,11 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
else if (outercmp == BMS_SUBSET1 &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
else if (outercmp == BMS_SUBSET2 &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
/* else different parameterizations, keep both */
}
break;
@@ -551,7 +551,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET1) &&
new_path->rows <= old_path->rows &&
new_path->parallel_safe >= old_path->parallel_safe)
- remove_old = true; /* new dominates old */
+ remove_old = true; /* new dominates old */
}
break;
case COSTS_BETTER2:
@@ -563,7 +563,7 @@ add_path(RelOptInfo *parent_rel, Path *new_path)
outercmp == BMS_SUBSET2) &&
new_path->rows >= old_path->rows &&
new_path->parallel_safe <= old_path->parallel_safe)
- accept_new = false; /* old dominates new */
+ accept_new = false; /* old dominates new */
}
break;
case COSTS_DIFFERENT:
@@ -751,7 +751,7 @@ add_path_precheck(RelOptInfo *parent_rel,
void
add_partial_path(RelOptInfo *parent_rel, Path *new_path)
{
- bool accept_new = true; /* unless we find a superior old path */
+ bool accept_new = true; /* unless we find a superior old path */
ListCell *insert_after = NULL; /* where to insert new item */
ListCell *p1;
ListCell *p1_prev;
@@ -1081,7 +1081,7 @@ create_bitmap_heap_path(PlannerInfo *root,
pathnode->path.parallel_aware = parallel_degree > 0 ? true : false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_degree;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapqual = bitmapqual;
@@ -1118,7 +1118,7 @@ create_bitmap_and_path(PlannerInfo *root,
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapquals = bitmapquals;
@@ -1154,7 +1154,7 @@ create_bitmap_or_path(PlannerInfo *root,
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->bitmapquals = bitmapquals;
@@ -1182,7 +1182,7 @@ create_tidscan_path(PlannerInfo *root, RelOptInfo *rel, List *tidquals,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* always unordered */
+ pathnode->path.pathkeys = NIL; /* always unordered */
pathnode->tidquals = tidquals;
@@ -1214,8 +1214,7 @@ create_append_path(RelOptInfo *rel, List *subpaths, Relids required_outer,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = rel->consider_parallel;
pathnode->path.parallel_workers = parallel_workers;
- pathnode->path.pathkeys = NIL; /* result is always considered
- * unsorted */
+ pathnode->path.pathkeys = NIL; /* result is always considered unsorted */
pathnode->partitioned_rels = list_copy(partitioned_rels);
pathnode->subpaths = subpaths;
@@ -1311,7 +1310,7 @@ create_merge_append_path(PlannerInfo *root,
else
{
/* We'll need to insert a Sort node, so include cost for that */
- Path sort_path; /* dummy for result of cost_sort */
+ Path sort_path; /* dummy for result of cost_sort */
cost_sort(&sort_path,
root,
@@ -1743,7 +1742,7 @@ create_gather_path(PlannerInfo *root, RelOptInfo *rel, Path *subpath,
pathnode->path.parallel_aware = false;
pathnode->path.parallel_safe = false;
pathnode->path.parallel_workers = 0;
- pathnode->path.pathkeys = NIL; /* Gather has unordered result */
+ pathnode->path.pathkeys = NIL; /* Gather has unordered result */
pathnode->subpath = subpath;
pathnode->num_workers = subpath->parallel_workers;
@@ -2818,8 +2817,8 @@ create_groupingsets_path(PlannerInfo *root,
}
else
{
- Path sort_path; /* dummy for result of cost_sort */
- Path agg_path; /* dummy for result of cost_agg */
+ Path sort_path; /* dummy for result of cost_sort */
+ Path agg_path; /* dummy for result of cost_agg */
if (rollup->is_hashed || is_first_sort)
{