Fix example plan in optimizer/README.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 23 Jan 2017 14:38:36 +0000 (09:38 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 23 Jan 2017 14:38:36 +0000 (09:38 -0500)
Joining three tables only takes two join nodes.  I think when I (tgl)
wrote this, I was envisioning possible additional joins; but since the
example doesn't show any fourth table, it's just confusing to write
a third join node.

Etsuro Fujita

Discussion: https://postgr.es/m/e6cfbaa3-af02-1abc-c25e-8fa5c6bc4e21@lab.ntt.co.jp

src/backend/optimizer/README

index 7ae2b74b2c2d2970e925b45f32741bbc8ca24b9a..fc0fca41071228cdd734693fc0e500f562c7c392 100644 (file)
@@ -757,9 +757,8 @@ to create a plan like
         -> Seq Scan on SmallTable1 A
         NestLoop
             -> Seq Scan on SmallTable2 B
-            NestLoop
-                -> Index Scan using XYIndex on LargeTable C
-                      Index Condition: C.X = A.AID and C.Y = B.BID
+            -> Index Scan using XYIndex on LargeTable C
+                 Index Condition: C.X = A.AID and C.Y = B.BID
 
 so we should be willing to pass down A.AID through a join even though
 there is no join order constraint forcing the plan to look like this.