Re: No optimization with a partition window in a view - Mailing list pgsql-bugs

From Tom Lane
Subject Re: No optimization with a partition window in a view
Date
Msg-id 14142.1392696653@sss.pgh.pa.us
Whole thread Raw
In response to Re: No optimization with a partition window in a view  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: No optimization with a partition window in a view
List pgsql-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

pgsql-bugs by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: No optimization with a partition window in a view
Next
From: Joshua Yanovski
Date:
Subject: Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument