Re: Push predicate down in view containing window function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philippe Girolami <philippe(dot)girolami(at)sensorly(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Push predicate down in view containing window function
Date: 2013-11-14 22:43:49
Message-ID: 32583.1384469029@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Philippe Girolami <philippe(dot)girolami(at)sensorly(dot)com> writes:
> Hello,
> Using postgres 9.1.9, I have a view that uses a window function. I then query that view with a predicate on one of the columns. Unfortunately, the predicate doesn't get pushed down into the view.
> Given that the predicate applies to a column that's being partitionned on, why wouldn't the optimizer push the predicate down ?

Because there is zero optimization around window functions right now.
It certainly isn't smart enough to decide that it'd be safe to push
down a constraint that only mentions partitioning columns.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2013-11-15 01:24:05 Re: Tuning 9.3 for 32 GB RAM
Previous Message Dang Minh Huong 2013-11-14 22:14:18 Re: Equivalent syntax of PL/SQL using array in PL/pgSQL