Re: Windowing Function Patch Review -> Performance Comparison.

From: "Vladimir Sitnikov" <sitnikov(dot)vladimir(at)gmail(dot)com>
To: "David Rowley" <dgrowley(at)gmail(dot)com>
Cc: "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, heikki(dot)linnakangas(at)enterprisedb(dot)com
Subject: Re: Windowing Function Patch Review -> Performance Comparison.
Date: 2008-11-02 02:56:23
Message-ID: 1d709ecc0811011956y48edcc1bh294332df5d257c53@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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'
from big_marathon
order by time
) results
where position=*2*

-- meter_readings
select '' >>> 'lag';

select date, reading::numeric-(case lag when '' then null else lag
end)::numeric as used
from (
select date, <<<'lag' as lag, reading::text >>>'lag' as reading
from meter_readings
order by date
) as t
order by used asc nulls last limit *1*

Best regards,
Vladimir Sitnikov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2008-11-02 03:45:17 Re: WIP: Column-level Privileges
Previous Message Stephen Frost 2008-11-02 02:18:46 Re: Please make sure your patches are on the wiki page