Re: CTE optimization fence on the todo list?
От
Bruce Momjian
Тема
Re: CTE optimization fence on the todo list?
Дата
Msg-id
20121001144929.GB30089@momjian.us
Ответ на
Re: CTE optimization fence on the todo list? (Tom Lane)
Список
Дерево обсуждения
Re: CTE optimization fence on the todo list? Chris Rogers <teukros@gmail.com>
Re: CTE optimization fence on the todo list? Robert Haas <robertmhaas@gmail.com>
Re: CTE optimization fence on the todo list? Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: CTE optimization fence on the todo list? Tom Lane <tgl@sss.pgh.pa.us>
Re: CTE optimization fence on the todo list? David Steele <david@pgmasters.net>
Re: CTE optimization fence on the todo list? Tom Lane <tgl@sss.pgh.pa.us>
Re: CTE optimization fence on the todo list? "David G. Johnston" <david.g.johnston@gmail.com>
Re: CTE optimization fence on the todo list? Peter Geoghegan <pg@heroku.com>
Re: CTE optimization fence on the todo list? David Steele <david@pgmasters.net>
Re: CTE optimization fence on the todo list? Qingqing Zhou <zhouqq.postgres@gmail.com>
Re: CTE optimization fence on the todo list? Robert Haas <robertmhaas@gmail.com>
Re: CTE optimization fence on the todo list? Peter Geoghegan <pg@heroku.com>
On Mon, Oct 1, 2012 at 10:07:01AM -0400, Tom Lane wrote: > Merlin Moncure writes: > > I'm wondering if there are any technical/standards constraints that > > are behind the fencing behavior. > > I think the key reason is that we don't want partial execution of DML > operations (ie, INSERT/UPDATE/DELETE inside a WITH). The fencing > behavior was put in originally because we foresaw adding DML later. > > We could possibly relax the rule for WITH SELECT only, but it would > be rather inconsistent, not to mention unpleasant for all the people > who are relying on the current behavior for one reason or another. > > Another issue is that if the CTE is scanned multiple times by the outer > query, you really can't optimize it on the basis of any one call site. If we wanted to relax the fencing, we might need to do it via an SQL keyword on the SELECT, to avoid the confusion caused by GUCs. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +
В списке pgsql-hackers по дате отправления