digraph { graph [rankdir = "LR", label = "Plan Tree: WITH RECURSIVE t(n) AS (VALUES(1) UNION ALL SELECT n + 1 FROM t WHERE n < 100) SELECT sum(n) FROM t;"] node [shape=record,style=filled,fillcolor=gray95] edge [arrowtail=empty] 20[label = " String (20)|n"] 18[label = " Alias (18)|aliasname: t| colnames: "] 19[label = " List (19)|<1> [0]"] 32[label = " Alias (32)|aliasname: *VALUES*| colnames: "] 33[label = " List (33)|<1> [0]"] 34[label = " String (34)|column1"] 22[label = " Alias (22)|aliasname: *SELECT* 1"] 23[label = " Alias (23)|aliasname: *SELECT* 1| colnames: "] 24[label = " List (24)|<1> [0]"] 25[label = " String (25)|column1"] 36[label = " Alias (36)|aliasname: t| colnames: "] 37[label = " List (37)|<1> [0]"] 38[label = " String (38)|n"] 27[label = " Alias (27)|aliasname: *SELECT* 2"] 28[label = " Alias (28)|aliasname: *SELECT* 2| colnames: "] 29[label = " List (29)|<1> [0]"] 30[label = " String (30)|?column?"] 44[label = " ValuesScan (44)|startup_cost: 0.00|total_cost: 0.01|plan_rows: 1|plan_width: 4| targetlist: |extParam: (b)|allParam: (b)|scanrelid: 4| values_lists: "] 51[label = " WorkTableScan (51)|startup_cost: 0.00|total_cost: 0.23|plan_rows: 3|plan_width: 4| targetlist: | qual: |extParam: (b 0)|allParam: (b 0)|scanrelid: 5|wtParam: 0"] 40[label = " RecursiveUnion (40)|startup_cost: 0.00|total_cost: 2.96|plan_rows: 31|plan_width: 4| targetlist: | lefttree: | righttree: |extParam: (b)|allParam: (b)|wtParam: 0|numCols: 0|dupColIdx:|dupOperators:|numGroups: "] 14[label = " SubPlan (14)|subLinkType: CTE_SUBLINK|plan_id: 1|plan_name: CTE t|firstColType: 23|firstColTypmod: -1|useHashTable: false|unknownEqFalse: false| setParam: |startup_cost: 0.00|per_call_cost: 2.96"] 15[label = " IntList (15)|1 "] 39[label = " List (39)|<1> [0]"] 13[label = " List (13)|<1> [0]"] 9[label = " CteScan (9)|startup_cost: 0.00|total_cost: 0.62|plan_rows: 31|plan_width: 4| targetlist: |extParam: (b)|allParam: (b)|scanrelid: 1|ctePlanId: 1|cteParam: 1"] 2[label = " Agg (2)|startup_cost: 3.65|total_cost: 3.66|plan_rows: 1|plan_width: 4| targetlist: | lefttree: | initPlan: |extParam: (b)|allParam: (b 1)|aggstrategy: AGG_PLAIN|numCols: 0|grpColIdx:|grpOperators:|numGroups: "] 17[label = " RangeTblEntry(RTE) (17)| eref: |rtekind: RTE_CTE|ctename: t|ctelevelsup: 0|self_reference: false|inh: false|inFromCl: true|requiredPerms: 0|selectedCols: (b)|modifiedCols: (b)"] 16[label = " List (16)|<1> [0]|<2> [1]|<3> [2]|<4> [3]|<5> [4]"] 21[label = " RangeTblEntry(RTE) (21)| alias: | eref: |rtekind: RTE_SUBQUERY|security_barrier: false|inh: false|inFromCl: false|requiredPerms: 0|selectedCols: (b)|modifiedCols: (b)"] 26[label = " RangeTblEntry(RTE) (26)| alias: | eref: |rtekind: RTE_SUBQUERY|security_barrier: false|inh: false|inFromCl: false|requiredPerms: 0|selectedCols: (b)|modifiedCols: (b)"] 31[label = " RangeTblEntry(RTE) (31)| eref: |rtekind: RTE_VALUES|inh: false|inFromCl: true|requiredPerms: 2|selectedCols: (b)|modifiedCols: (b)"] 50[label = " Const (50)|consttype: 23|consttypmod: -1|constlen: 4|constbyval: true|constisnull: false|location: 31"] 49[label = " List (49)|<1> [0]"] 48[label = " List (48)|<1> [0]"] 35[label = " RangeTblEntry(RTE) (35)| eref: |rtekind: RTE_CTE|ctename: t|ctelevelsup: 2|self_reference: true|inh: false|inFromCl: true|requiredPerms: 0|selectedCols: (b)|modifiedCols: (b)"] 1[label = " PlannedStmt (1)|commandType: CMD_SELECT|queryId: 0|hasReturning: false|hasModifyingCTE: false|canSetTag: true|transientPlan: false| planTree: | rtable: | subplans: |rewindPlanIDs: (b)|nParamExec: 2"] 18:colnames -> 19:head [headlabel = "18", taillabel = "19"] 19:1 -> 20:head [headlabel = "19", taillabel = "20"] 32:colnames -> 33:head [headlabel = "32", taillabel = "33"] 33:1 -> 34:head [headlabel = "33", taillabel = "34"] 23:colnames -> 24:head [headlabel = "23", taillabel = "24"] 24:1 -> 25:head [headlabel = "24", taillabel = "25"] 36:colnames -> 37:head [headlabel = "36", taillabel = "37"] 37:1 -> 38:head [headlabel = "37", taillabel = "38"] 28:colnames -> 29:head [headlabel = "28", taillabel = "29"] 29:1 -> 30:head [headlabel = "29", taillabel = "30"] 44:targetlist -> 45:head [headlabel = "44", taillabel = "45"] 44:values_lists -> 48:head [headlabel = "44", taillabel = "48"] 51:targetlist -> 52:head [headlabel = "51", taillabel = "52"] 51:qual -> 58:head [headlabel = "51", taillabel = "58"] 40:lefttree -> 44:head [headlabel = "40", taillabel = "44"] 40:righttree -> 51:head [headlabel = "40", taillabel = "51"] 40:targetlist -> 41:head [headlabel = "40", taillabel = "41"] 14:setParam -> 15:head [headlabel = "14", taillabel = "15"] 39:1 -> 40:head [headlabel = "39", taillabel = "40"] 13:1 -> 14:head [headlabel = "13", taillabel = "14"] 9:targetlist -> 10:head [headlabel = "9", taillabel = "10"] 2:initPlan -> 13:head [headlabel = "2", taillabel = "13"] 2:lefttree -> 9:head [headlabel = "2", taillabel = "9"] 2:targetlist -> 3:head [headlabel = "2", taillabel = "3"] 17:eref -> 18:head [headlabel = "17", taillabel = "18"] 16:1 -> 17:head [headlabel = "16", taillabel = "17"] 16:2 -> 21:head [headlabel = "16", taillabel = "21"] 16:3 -> 26:head [headlabel = "16", taillabel = "26"] 16:4 -> 31:head [headlabel = "16", taillabel = "31"] 16:5 -> 35:head [headlabel = "16", taillabel = "35"] 21:alias -> 22:head [headlabel = "21", taillabel = "22"] 21:eref -> 23:head [headlabel = "21", taillabel = "23"] 26:alias -> 27:head [headlabel = "26", taillabel = "27"] 26:eref -> 28:head [headlabel = "26", taillabel = "28"] 31:eref -> 32:head [headlabel = "31", taillabel = "32"] 49:1 -> 50:head [headlabel = "49", taillabel = "50"] 48:1 -> 49:head [headlabel = "48", taillabel = "49"] 35:eref -> 36:head [headlabel = "35", taillabel = "36"] 1:subplans -> 39:head [headlabel = "1", taillabel = "39"] 1:planTree -> 2:head [headlabel = "1", taillabel = "2"] 1:rtable -> 16:head [headlabel = "1", taillabel = "16"] subgraph cluster_0 { label = "Target List"; 12[label = " Var (12)|varno: 1|varattno: 1|vartype: 23|vartypmod: -1|varlevelsup: 0|varnoold: 1|varoattno: 1"] 11[label = " TargetEntry (11)| expr: |resno: 1|resjunk: false"] 10[label = " List (10)|<1> [0]"] 11:expr -> 12:head [headlabel = "11", taillabel = "12"] 10:1 -> 11:head [headlabel = "10", taillabel = "11"] } subgraph cluster_1 { label = "Target List"; 41[label = " List (41)|<1> [0]"] 43[label = " Var (43)|varno: OUTER_VAR|varattno: 1|vartype: 23|vartypmod: -1|varlevelsup: 0|varnoold: 1|varoattno: 1"] 42[label = " TargetEntry (42)| expr: |resno: 1|resname: column1|resjunk: false"] 41:1 -> 42:head [headlabel = "41", taillabel = "42"] 42:expr -> 43:head [headlabel = "42", taillabel = "43"] } subgraph cluster_2 { label = "Target List"; 5[label = " Aggref (5)|aggfnoid: 2108|aggtype: 20| args: |aggstar: false|aggvariadic: false|aggkind: 110|agglevelsup: 0|location: 86"] 7[label = " TargetEntry (7)| expr: |resno: 1|resjunk: false"] 8[label = " Var (8)|varno: OUTER_VAR|varattno: 1|vartype: 23|vartypmod: -1|varlevelsup: 0|varnoold: 1|varoattno: 1|location: 90"] 6[label = " List (6)|<1> [0]"] 4[label = " TargetEntry (4)| expr: |resno: 1|resname: sum|resjunk: false"] 3[label = " List (3)|<1> [0]"] 5:args -> 6:head [headlabel = "5", taillabel = "6"] 7:expr -> 8:head [headlabel = "7", taillabel = "8"] 6:1 -> 7:head [headlabel = "6", taillabel = "7"] 4:expr -> 5:head [headlabel = "4", taillabel = "5"] 3:1 -> 4:head [headlabel = "3", taillabel = "4"] } subgraph cluster_3 { label = "Target List"; 46[label = " TargetEntry (46)| expr: |resno: 1|resname: column1|resjunk: false"] 47[label = " Var (47)|varno: 4|varattno: 1|vartype: 23|vartypmod: -1|varlevelsup: 0|varnoold: 4|varoattno: 1"] 45[label = " List (45)|<1> [0]"] 46:expr -> 47:head [headlabel = "46", taillabel = "47"] 45:1 -> 46:head [headlabel = "45", taillabel = "46"] } subgraph cluster_4 { label = "Target List"; 53[label = " TargetEntry (53)| expr: |resno: 1|resname: column1|resjunk: false"] 54[label = " OpExpr (54)|opno: 551|opfuncid: 177|opresulttype: 23|opretset: false| args: |location: 53"] 56[label = " Var (56)|varno: 5|varattno: 1|vartype: 23|vartypmod: -1|varlevelsup: 0|varnoold: 5|varoattno: 1|location: 51"] 55[label = " List (55)|<1> [0]|<2> [1]"] 57[label = " Const (57)|consttype: 23|consttypmod: -1|constlen: 4|constbyval: true|constisnull: false|location: 55"] 52[label = " List (52)|<1> [0]"] 53:expr -> 54:head [headlabel = "53", taillabel = "54"] 54:args -> 55:head [headlabel = "54", taillabel = "55"] 55:1 -> 56:head [headlabel = "55", taillabel = "56"] 55:2 -> 57:head [headlabel = "55", taillabel = "57"] 52:1 -> 53:head [headlabel = "52", taillabel = "53"] } subgraph cluster_5 { label = "Express Tree"; 59[label = " OpExpr (59)|opno: 97|opfuncid: 66|opresulttype: 16|opretset: false| args: |location: 72"] 61[label = " Var (61)|varno: 5|varattno: 1|vartype: 23|vartypmod: -1|varlevelsup: 0|varnoold: 5|varoattno: 1|location: 70"] 60[label = " List (60)|<1> [0]|<2> [1]"] 62[label = " Const (62)|consttype: 23|consttypmod: -1|constlen: 4|constbyval: true|constisnull: false|location: 74"] 58[label = " List (58)|<1> [0]"] 59:args -> 60:head [headlabel = "59", taillabel = "60"] 60:1 -> 61:head [headlabel = "60", taillabel = "61"] 60:2 -> 62:head [headlabel = "60", taillabel = "62"] 58:1 -> 59:head [headlabel = "58", taillabel = "59"] } }