Re: plan time of MASSIVE partitioning ...
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <bruce@momjian.us>, Leonardo Francalanci <m_lists@yahoo.it>, Boszormenyi Zoltan <zb@cybertec.at>, pgsql-hackers Hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-13T22:26:34Z
Lists: pgsql-hackers
On Fri, Nov 12, 2010 at 10:55 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Bruce Momjian <bruce@momjian.us> writes: >> FYI, I always wondered if the rare use of mergejoins justified the extra >> planning time of carrying around all those joinpaths. > > They're hardly rare. They fairly rare in the sorts of queries I normally issue, but I'd quibble with the statement on other grounds: IME, we generate far more nest loops paths than anything else. The comment in match_unsorted_outer() says it all: * We always generate a nestloop path for each available outer path. * In fact we may generate as many as five: one on the cheapest-total-cost * inner path, one on the same with materialization, one on the * cheapest-startup-cost inner path (if different), one on the * cheapest-total inner-indexscan path (if any), and one on the * cheapest-startup inner-indexscan path (if different). -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company