pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: pinaraf@pinaraf.info
Cc: pgsql-bugs@postgresql.org
Subject: Re: No optimization with a partition window in a view
Date: Mon, 17 Feb 2014 23:10:53 -0500
Message-ID: <14142.1392696653@sss.pgh.pa.us> (raw)
In-Reply-To: <20140218.115022.08614214.horiguchi.kyotaro@lab.ntt.co.jp>
References: <6539554.0HoVISsQxY@peanuts2>
	<20140218.115022.08614214.horiguchi.kyotaro@lab.ntt.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
> Hello, this seems to be a matter of subquery pushdown, query
> transform involving subqueries or how to deal with views in
> planner, rather than a bug.

In general, pushing a WHERE clause down through a window function call
*would* be a bug.  I think it should be safe in this case because the
WHERE clause matches the window functions' partition clauses, so that
applying the WHERE removes either all or none of the rows of any
particular partition.  We've not gotten around to that type of refinement
in window function planning, yet.  It would take some infrastructure that
doesn't exist now --- I don't recall that we have any code that tries to
make that particular kind of proof.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)  latest in thread

Message-ID: <14142.1392696653@sss.pgh.pa.us>
Permalink:  ../14142.1392696653@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14142.1392696653@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, horiguchi.kyotaro@lab.ntt.co.jp, pinaraf@pinaraf.info
  Subject: Re: No optimization with a partition window in a view
  In-Reply-To: <14142.1392696653@sss.pgh.pa.us>
  References: <6539554.0HoVISsQxY@peanuts2> <20140218.115022.08614214.horiguchi.kyotaro@lab.ntt.co.jp> <14142.1392696653@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox