Re: Speeding up Aggregates

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Dror Matalon <dror(at)zapatec(dot)com>
Cc: Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Speeding up Aggregates
Date: 2003-10-03 23:32:16
Message-ID: 1065219071.91586.11.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


> > I hope it isn't the first or second one ;)
>
> CREATE or REPLACE FUNCTION item_max_date (int4, varchar) RETURNS
> timestamptz AS '
> select max(dtstamp) from items where channel = $1 and link = $2;
> ' LANGUAGE 'sql';

How about the below?

CREATE or REPLACE FUNCTION item_max_date (int4, varchar) RETURNS
timestamptz AS '
select max(dtstamp) from items where channel = $1 and link = $2;
' LANGUAGE 'sql' STABLE;

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Matt Clark 2003-10-03 23:44:33 Re: reindex/vacuum locking/performance?
Previous Message Matt Clark 2003-10-03 23:29:55 Re: reindex/vacuum locking/performance?