Re: [HACKERS] Windowing Qual Pushdown

2010-03-23 Thread Daniel Farina
On Tue, Mar 23, 2010 at 8:23 AM, Tom Lane wrote: > The real question is what benefit you expect to get.  If the filter > condition can't be pushed below the window functions (which AFAICS Even on the partition key? Right now if you define a view with a windowing + PARTITION BY clause in it and p

Re: [HACKERS] Windowing Qual Pushdown

2010-03-23 Thread Tom Lane
Hitoshi Harada writes: > I believe the changes will probably not be 2-3 lines (ie. a member > added to Query structure, etc) if I try it. But the optimizer part is > too complicated to me so that I am not sure, either. My idea above is > that the similar mechanism you see in GROUP BY optimization

Re: [HACKERS] Windowing Qual Pushdown

2010-03-23 Thread Hitoshi Harada
2010/3/23 Daniel Farina : > On Tue, Mar 23, 2010 at 12:40 AM, Hitoshi Harada wrote: >> I believe the changes will probably not be 2-3 lines (ie. a member >> added to Query structure, etc) if I try it. But the optimizer part is >> too complicated to me so that I am not sure, either. My idea above i

Re: [HACKERS] Windowing Qual Pushdown

2010-03-23 Thread Daniel Farina
On Tue, Mar 23, 2010 at 12:40 AM, Hitoshi Harada wrote: > I believe the changes will probably not be 2-3 lines (ie. a member > added to Query structure, etc) if I try it. But the optimizer part is > too complicated to me so that I am not sure, either. My idea above is > that the similar mechanism

Re: [HACKERS] Windowing Qual Pushdown

2010-03-23 Thread Hitoshi Harada
2010/3/23 Daniel Farina : > On Tue, Mar 23, 2010 at 12:19 AM, Hitoshi Harada wrote: >> If you implement that optimization, we need have kind of >> implicit, homologous qual information. Sure, it's possible. > > I'm not sure precisely what you mean here.  Do you predict the > mechanism will be comp

Re: [HACKERS] Windowing Qual Pushdown

2010-03-23 Thread Daniel Farina
On Tue, Mar 23, 2010 at 12:19 AM, Hitoshi Harada wrote: > If you implement that optimization, we need have kind of > implicit, homologous qual information. Sure, it's possible. I'm not sure precisely what you mean here. Do you predict the mechanism will be complicated? It's been a burning itch

Re: [HACKERS] Windowing Qual Pushdown

2010-03-23 Thread Hitoshi Harada
2010/3/21 Daniel Farina : > 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 oth

[HACKERS] Windowing Qual Pushdown

2010-03-20 Thread Daniel Farina
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? fdr --