Odd plan shown in src/backend/optimizer/README

Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>

From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: pgsql-hackers@postgresql.org
Date: 2017-01-23T10:11:46Z
Lists: pgsql-hackers

Attachments

While working on a bug in postgres_fdw, I found this:

      NestLoop
          -> 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

This seems odd to me; we would not need the bottom-level Nestloop.  
Attached is a small patch for fixing that.  I also adjusted the  
indentation to the last line "Index Condition: ...", to match others in  
the section of Parameterized Paths.

Best regards,
Etsuro Fujita

Commits

  1. Fix example plan in optimizer/README.