Show motion path and path locus type in print_path().
* Show motion path and path locus type in print_path().
This helps gpdb planner debugging.
* Review comments from Heikki Linnakangas
@@ -2341,6 +2341,7 @@ static void
print_path(PlannerInfo *root, Path *path, int indent)
{
const char *ptype;
+ const char *ltype;
bool join = false;
Path *subpath = NULL;
int i;
@@ -2403,6 +2404,10 @@ print_path(PlannerInfo *root, Path *path, int indent)
ptype = "HashJoin";
join = true;
break;
+ case T_CdbMotionPath:
+ ptype = "Motion";
+ subpath = ((CdbMotionPath *) path)->subpath;
+ break;
default:
ptype = "???Path";
break;
@@ -2418,6 +2423,38 @@ print_path(PlannerInfo *root, Path *path, int indent)
print_relids(path->parent->relids);
printf(") rows=%.0f", path->parent->rows);
}
+
+ switch (path->locus.locustype)
+ {
+ case CdbLocusType_Entry:
+ ltype = "Entry";
+ break;
+ case CdbLocusType_SingleQE:
+ ltype = "SingleQE";
+ break;
+ case CdbLocusType_General:
+ ltype = "General";
+ break;
+ case CdbLocusType_SegmentGeneral:
+ ltype = "SegmentGeneral";
+ break;
+ case CdbLocusType_Replicated:
+ ltype = "Replicated";
+ break;
+ case CdbLocusType_Hashed:
+ ltype = "Hashed";
+ break;
+ case CdbLocusType_HashedOJ:
+ ltype = "HashedOJ";
+ break;
+ case CdbLocusType_Strewn:
+ ltype = "Strewn";
+ break;
+ default:
+ ltype = "???CdbLocus";
+ break;
+ }
+ printf(" locus=%s", ltype);
printf(" cost=%.2f..%.2f\n", path->startup_cost, path->total_cost);
if (path->pathkeys)
