Re: Analysis Function
От | David Jarvis |
---|---|
Тема | Re: Analysis Function |
Дата | |
Msg-id | AANLkTinjUmGWmB3jsjj-6w_44c0K7f_wSrH_1TALPaOY@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Analysis Function (Andy Colson <andy@squeakycode.net>) |
Ответы |
Re: Analysis Function
|
Список | pgsql-performance |
Hi, Andy.
Yes. Here are the variations I have benchmarked (times are best of three):
Variation #0
Variation #1
Variation #2
Variation #3
Variation #4
What I would like is along Variation #5:
I find it interesting that variation #2 is half a second slower than variation #1.
The other question I have is: why does PG seem to discard the results? In pgAdmin3, I can keep pressing F5 and (before 8.4.4?) the results came back in 4s for the first response then 1s in subsequent responses.
Dave
I assume you are doing this in a loop? Many Many Many times? cuz:
Yes. Here are the variations I have benchmarked (times are best of three):
Variation #1
Variation #2
Variation #3
Variation #4
to_date( date_part('YEAR', m.taken)::text, 'YYYY' ) + interval '0 months' + interval '0 days'
Explain: http://explain.depesz.com/s/fIT
Time: 4.4s
Explain: http://explain.depesz.com/s/fIT
Time: 4.4s
What I would like is along Variation #5:
PGTYPESdate_mdyjul(taken_year, p_month1, p_day1)
Time: 2.3s
Time: 2.3s
I find it interesting that variation #2 is half a second slower than variation #1.
The other question I have is: why does PG seem to discard the results? In pgAdmin3, I can keep pressing F5 and (before 8.4.4?) the results came back in 4s for the first response then 1s in subsequent responses.
Dave
В списке pgsql-performance по дате отправления: