Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-16 Thread Hitoshi Harada
2008/11/15 David Rowley [EMAIL PROTECTED]: Hitoshi Harada wrote: david=# explain select date,lag(date,1) over (order by date) from meter_Readings order by date; QUERY PLAN

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-14 Thread David Rowley
Hitoshi Harada wrote: david=# explain select date,lag(date,1) over (order by date) from meter_Readings order by date; QUERY PLAN

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-10 Thread Hitoshi Harada
2008/11/10 David Rowley [EMAIL PROTECTED]: Hitoshi Harada wrote: I found how to do it, though it's only on the case you gave. Thinking about the planner optimization of the Window nodes (and its attached Sort nodes), we must consider the execution order of more than one node. In the test case

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-09 Thread David Rowley
Hitoshi Harada wrote: I found how to do it, though it's only on the case you gave. Thinking about the planner optimization of the Window nodes (and its attached Sort nodes), we must consider the execution order of more than one node. In the test case we only take care of only one window, but

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-09 Thread David Rowley
Hitoshi Harada wrote: I found how to do it, though it's only on the case you gave. Thinking about the planner optimization of the Window nodes (and its attached Sort nodes), we must consider the execution order of more than one node. In the test case we only take care of only one window, but

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-04 Thread David Rowley
Hitoshi Harada wrote: Test 3 and 5 did not seem to make use of an index to get a sorted list of results. I disabled enable_seqscan but the planner still failed to choose index_scan. Is there any reason for this? Perhaps I'm missing something. Hitoshi, can you take a look at this?

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-03 Thread Hitoshi Harada
2008/11/2 David Rowley [EMAIL PROTECTED]: Hitoshi Harada Wrote: 2008/11/2 David Rowley [EMAIL PROTECTED]: Obervations: Test 3 and 5 did not seem to make use of an index to get a sorted list of results. I disabled enable_seqscan but the planner still failed to choose index_scan. Is

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-02 Thread David Rowley
Hitoshi Harada Wrote: Thanks for your test. Didn't post publicly, I've also tested real problems and performed better than I thought. If you can afford it, could you add selfjoin cases? It's like: Ok, did self joins with some. I don't know if it's possible with all. Test Sub query Self join

[HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-01 Thread David Rowley
All, This is my first patch review for PostgreSQL. I did submit a patch last commit fest (Boyer-Moore) so I feel I should review one this commit fest. I'm quite new to PostgreSQL so please don't rely on me totally. I'll do my best. Heikki is also reviewing this patch which makes me feel better.

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-01 Thread Vladimir Sitnikov
Here is another way to solve big marathon without window functions (and many other kinds of windowing queries, especially those that do not specify rows preceeding etc.). It could be considered as a very dirty hack, however it could give you an insight on the performance of the windowed query

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-01 Thread Vladimir Sitnikov
Just a small correction: there should be time::text'prev_time' for the calculations to be correct: select * from ( select (((case when time::text = 'prev_time' then *0* else *1* end)+('dense_rank')::int4)::text'dense_rank')::int4 as position, runnerid, time, time::text'prev_time'

Re: [HACKERS] Windowing Function Patch Review - Performance Comparison.

2008-11-01 Thread Hitoshi Harada
2008/11/2 David Rowley [EMAIL PROTECTED]: Obervations: Test 3 and 5 did not seem to make use of an index to get a sorted list of results. I disabled enable_seqscan but the planner still failed to choose index_scan. Is there any reason for this? Perhaps I'm missing something. Hitoshi, can you