Re: add_path() for Path without InitPlan: cost comparison vs. Paths that require one

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dent John <denty(at)qqdd(dot)eu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: add_path() for Path without InitPlan: cost comparison vs. Paths that require one
Date: 2019-07-25 13:25:16
Message-ID: 9080.1564061116@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dent John <denty(at)qqdd(dot)eu> writes:
> However, if I factor back in the cost of the InitPlan, things net out much more in favour of a scan against the MV. Of course, the add_path() comparison logic doesn’t include the InitPlan cost, so the point is moot.

Please explain yourself. InitPlans will, as a rule, get stuck into the
same place in the plan tree regardless of which paths are chosen; that's
why we need not consider them in path cost comparisons. Moreover, once
the initplan's own subplan is determined, it's going to be the same
regardless of the shape of the outer query --- so if we did factor it
in, it'd contribute the same cost to every outer path, and thus it
still wouldn't change any decisions. So I don't follow what you're
on about here.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rafia Sabih 2019-07-25 14:10:47 Re: Initdb failure
Previous Message pantilimonov michael 2019-07-25 12:34:08 Re: [GSoC] artbufmgr