Re: Windowing Qual Pushdown - Mailing list pgsql-hackers

From Hitoshi Harada
Subject Re: Windowing Qual Pushdown
Date
Msg-id e08cc0401003230019l53f9ee93t758239519a4cc3fe@mail.gmail.com
Whole thread Raw
In response to Windowing Qual Pushdown  (Daniel Farina <drfarina@acm.org>)
Responses Re: Windowing Qual Pushdown
List pgsql-hackers
2010/3/21 Daniel Farina <drfarina@acm.org>:
> In the function "subquery_is_pushdown_safe", there is an immediate
> "false" returned if the subquery has a windowing function.  While that
> seems true in general, are there cases where we can push down a qual
> if it is on the partitioning key?  Or do NULLs or some other detail
> get in the way?

Ugh, that seems true. In similar case you can push down WHERE clause
of outer query to subquery if the qual clause match GROUP BY clause.
This is done by transforming outer WHERE -> HAVING -> inner WHERE.
However, window function querys don't have such clause as HAVING of
aggregate. If you implement that optimization, we need have kind of
implicit, homologous qual information. Sure, it's possible.

Regards,


--
Hitoshi Harada


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Make standby server continuously retry restoring the next WAL
Next
From: Daniel Farina
Date:
Subject: Re: Windowing Qual Pushdown