]> granicus.if.org Git - postgresql/commitdiff
Fix print of Path nodes when using OPTIMIZER_DEBUG
authorMichael Paquier <michael@paquier.xyz>
Thu, 19 Jul 2018 00:55:32 +0000 (09:55 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 19 Jul 2018 00:55:32 +0000 (09:55 +0900)
GatherMergePath (introduced in 10) and CustomPath (introduced in 9.5)
have gone missing.  The order of the Path nodes was inconsistent with
what is listed in nodes.h, so make the order consistent at the same time
to ease future checks and additions.

Author: Sawada Masahiko
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/CAD21AoBQMLoc=ohH-oocuAPsELrmk8_EsRJjOyR8FQLZkbE0wA@mail.gmail.com

src/backend/optimizer/path/allpaths.c

index 8fc1cfd15f5330a44c537eec49e5eecc93dac27f..42d7aa6c3fbe16b1980c8cd59399a76be242f591 100644 (file)
@@ -2564,12 +2564,27 @@ print_path(PlannerInfo *root, Path *path, int indent)
                case T_BitmapOrPath:
                        ptype = "BitmapOrPath";
                        break;
+               case T_NestPath:
+                       ptype = "NestLoop";
+                       join = true;
+                       break;
+               case T_MergePath:
+                       ptype = "MergeJoin";
+                       join = true;
+                       break;
+               case T_HashPath:
+                       ptype = "HashJoin";
+                       join = true;
+                       break;
                case T_TidPath:
                        ptype = "TidScan";
                        break;
                case T_ForeignPath:
                        ptype = "ForeignScan";
                        break;
+               case T_CustomPath:
+                       ptype = "CustomScan";
+                       break;
                case T_AppendPath:
                        ptype = "Append";
                        break;
@@ -2587,18 +2602,6 @@ print_path(PlannerInfo *root, Path *path, int indent)
                        ptype = "Unique";
                        subpath = ((UniquePath *) path)->subpath;
                        break;
-               case T_NestPath:
-                       ptype = "NestLoop";
-                       join = true;
-                       break;
-               case T_MergePath:
-                       ptype = "MergeJoin";
-                       join = true;
-                       break;
-               case T_HashPath:
-                       ptype = "HashJoin";
-                       join = true;
-                       break;
                default:
                        ptype = "???Path";
                        break;