Re: [HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-11-18 Thread Sameer Kumar
On Thu, Nov 14, 2013 at 6:51 PM, Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > Hello, > > > When I read it again and try to relate, I get your point. Actually true, > > hashes must always be performed as last option (if that is what you too > > meant) and if there are few other ope

Re: [HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-11-14 Thread Kyotaro HORIGUCHI
Hello, > When I read it again and try to relate, I get your point. Actually true, > hashes must always be performed as last option (if that is what you too > meant) and if there are few other operations they must be the last one to > be performed especially after sorting/grouping. Hashes must some

Re: [HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-11-05 Thread Sameer Kumar
> Hello, > > > > With this index, you will get a different plan like this, > > > > > Exactly my point, can we look at making windowing functions > > smart and make use of available indexes? > > I might have guessed.. > > > > > Does this satisfies your needs? > > > > > Not exactly. If I have missed

Re: [HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-10-29 Thread Kyotaro HORIGUCHI
Hello, > > With this index, you will get a different plan like this, > > > Exactly my point, can we look at making windowing functions > smart and make use of available indexes? I might have guessed.. > > Does this satisfies your needs? > > > Not exactly. If I have missed to mention, this is no

Re: [HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-10-28 Thread Sameer Kumar
> > > > > Agree that windowing function will return all the rows compared to max > and > > group by returing only max rows per group. But even while arriving at the > > aggregate/sorting windowing function seems to spend more effort than > group > > by/order by. > > (I'll apologise in advance for p

Re: [HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-10-24 Thread Kyotaro HORIGUCHI
Hello, > Agree that windowing function will return all the rows compared to max and > group by returing only max rows per group. But even while arriving at the > aggregate/sorting windowing function seems to spend more effort than group > by/order by. (I'll apologise in advance for possible misr

Re: [HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-10-23 Thread Sameer Kumar
Agree that windowing function will return all the rows compared to max and group by returing only max rows per group. But even while arriving at the aggregate/sorting windowing function seems to spend more effort than group by/order by. I am just trying to see if we could somehow optimize the way

[HACKERS] Re: Using indexes for ORDER BY and PARTITION BY clause in windowing functions

2013-10-23 Thread David Johnston
Sameer Kumar wrote > edb=# explain analyze select max(score) from student_score group by > course; This query returns 6 records. The window one returns 123,000. Why do you expect these to have anywhere near the same performance or plan? You can enable/disable indexes/scans to see what alternati