From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Qingqing Zhou <zhouqq(dot)postgres(at)gmail(dot)com> |
Cc: | Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, Greg Stark <stark(at)mit(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Our trial to TPC-DS but optimizer made unreasonable plan |
Date: | 2015-08-27 00:28:27 |
Message-ID: | 23177.1440635307@sss.pgh.pa.us |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I wrote:
> What I had in mind in <38448(dot)1430519406(at)sss(dot)pgh(dot)pa(dot)us> was to convert CTEs
> into plain subqueries during the prepjointree phase, either just before
> or as part of the pull_up_subqueries pass (since you'd want the converted
> subquery to be flattened if possible).
After looking at the code a bit, IMO the most reasonable thing to do is to
include this transformation in inline_set_returning_functions(), perhaps
renaming it to something like inline_srfs_and_ctes(). You could invent
a separate function instead, but that would require an extra pass over
the rangetable, for no particular benefit that I can see; the separate
function would have to be called from *exactly* the same set of places
as inline_set_returning_functions(), anyway, or it would not work right
for multiple levels of query optimization.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Noah Misch | 2015-08-27 01:19:09 | Re: 9.4 broken on alpha |
Previous Message | Tom Lane | 2015-08-27 00:02:41 | Re: Our trial to TPC-DS but optimizer made unreasonable plan |