Skip to content

Commit 003788e

Browse files
committed
Make _outPathInfo print the relid set of the path's parent rel.
We can't actually print the parent RelOptInfo in toto, because that would lead to infinite recursion. But it's safe enough to reach into the parent and print its identifying relids, and that makes it a whole lot easier to figure out what a Path represents. Should have done this years ago.
1 parent 7e8c25c commit 003788e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/nodes/outfuncs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,12 +1352,15 @@ _outFromExpr(StringInfo str, FromExpr *node)
13521352
/*
13531353
* print the basic stuff of all nodes that inherit from Path
13541354
*
1355-
* Note we do NOT print the parent, else we'd be in infinite recursion
1355+
* Note we do NOT print the parent, else we'd be in infinite recursion.
1356+
* We can print the parent's relids for identification purposes, though.
13561357
*/
13571358
static void
13581359
_outPathInfo(StringInfo str, Path *node)
13591360
{
13601361
WRITE_ENUM_FIELD(pathtype, NodeTag);
1362+
appendStringInfo(str, " :parent_relids ");
1363+
_outBitmapset(str, node->parent->relids);
13611364
WRITE_FLOAT_FIELD(startup_cost, "%.2f");
13621365
WRITE_FLOAT_FIELD(total_cost, "%.2f");
13631366
WRITE_NODE_FIELD(pathkeys);

0 commit comments

Comments
 (0)