Re: [HACKERS] query_planner() API change

2013-08-05 Thread Atri Sharma
On Mon, Aug 5, 2013 at 6:19 PM, Tom Lane wrote: > Atri Sharma writes: >>> While we could complicate query_planner()'s API even more to add some >>> understanding of unnecessary resjunk items, I think this is probably >>> the straw that breaks the camel's back for the current approach here. >>> Th

Re: [HACKERS] query_planner() API change

2013-08-05 Thread Tom Lane
Ashutosh Bapat writes: > Can we change the query_planner() to return both the paths (presorted and > unsorted) irrespective of the cost of presorted path, and let > grouping_planner() (or any caller of query_planner()) handle which of them > to pick up? That's exactly the result this change would

Re: [HACKERS] query_planner() API change

2013-08-05 Thread Tom Lane
Atri Sharma writes: >> While we could complicate query_planner()'s API even more to add some >> understanding of unnecessary resjunk items, I think this is probably >> the straw that breaks the camel's back for the current approach here. >> There is already a comment like this in query_planner():

Re: [HACKERS] query_planner() API change

2013-08-05 Thread Etsuro Fujita
> On Mon, Aug 5, 2013 at 3:50 AM, Tom Lane wrote: >> I've been looking at what it would take to do proper cost estimation >> for the recently-discussed patch to suppress calculation of >> unnecessary ORDER BY expressions. > Can you please mention the subject of the thread? I tried to locate the t

Re: [HACKERS] query_planner() API change

2013-08-05 Thread Etsuro Fujita
> I agree with the idea,but am trying to understand why adding understanding of > resjunk columns is a bad idea. Just for understanding purpose, could you please > elaborate a bit on it? Although I may not have understood your question correctly, I think it is good to see http://www.postgresql.or

Re: [HACKERS] query_planner() API change

2013-08-05 Thread Ashutosh Bapat
On Mon, Aug 5, 2013 at 3:50 AM, Tom Lane wrote: > I've been looking at what it would take to do proper cost estimation > for the recently-discussed patch to suppress calculation of unnecessary > ORDER BY expressions. Can you please mention the subject of the thread? I tried to locate the thread

Re: [HACKERS] query_planner() API change

2013-08-04 Thread Atri Sharma
> While we could complicate query_planner()'s API even more to add some > understanding of unnecessary resjunk items, I think this is probably > the straw that breaks the camel's back for the current approach here. > There is already a comment like this in query_planner(): > > * This introduce

Re: [HACKERS] query_planner() API change

2013-08-04 Thread Etsuro Fujita
> Robert Haas writes: > > On Sun, Aug 4, 2013 at 6:20 PM, Tom Lane wrote: > >> I think it's time to bite the bullet and *not* pass back completed paths. > >> What's looking more attractive now is to just pass back the top-level > >> RelOptInfo ("final_rel" in query_planner()). > > > I tend to th

Re: [HACKERS] query_planner() API change

2013-08-04 Thread Tom Lane
Robert Haas writes: > On Sun, Aug 4, 2013 at 6:20 PM, Tom Lane wrote: >> I think it's time to bite the bullet and *not* pass back completed paths. >> What's looking more attractive now is to just pass back the top-level >> RelOptInfo ("final_rel" in query_planner()). > I tend to think this is a

Re: [HACKERS] query_planner() API change

2013-08-04 Thread Robert Haas
On Sun, Aug 4, 2013 at 6:20 PM, Tom Lane wrote: > I've been looking at what it would take to do proper cost estimation > for the recently-discussed patch to suppress calculation of unnecessary > ORDER BY expressions. It turns out that knowledge of that would have > to propagate into query_planner

[HACKERS] query_planner() API change

2013-08-04 Thread Tom Lane
I've been looking at what it would take to do proper cost estimation for the recently-discussed patch to suppress calculation of unnecessary ORDER BY expressions. It turns out that knowledge of that would have to propagate into query_planner(), because the place where we do the cost comparison bet