Odd plan shown in src/backend/optimizer/README

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Odd plan shown in src/backend/optimizer/README
Date: 2017-01-23 10:11:46
Message-ID: e6cfbaa3-af02-1abc-c25e-8fa5c6bc4e21@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
optimizer-readme.patch text/x-patch 913 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-01-23 10:17:36 Re: pageinspect: Hash index support
Previous Message Etsuro Fujita 2017-01-23 09:56:07 Re: postgres_fdw bug in 9.6