pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Dror Matalon <dror@zapatec.com>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Speeding up Aggregates
Date: Fri, 03 Oct 2003 19:32:16 -0400
Message-ID: <1065219071.91586.11.camel@jester> (raw)
In-Reply-To: <20031003215347.GQ87525@rlx11.zapatec.com>
References: <20031003202120.GO87525@rlx11.zapatec.com>
	<1065217488.91586.3.camel@jester>
	<20031003215347.GQ87525@rlx11.zapatec.com>


> > 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;

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (22+ messages)  latest in thread

Message-ID: <1065219071.91586.11.camel@jester>
Permalink:  ../1065219071.91586.11.camel@jester/
Also on:    postgresql.org/message-id/1065219071.91586.11.camel@jester

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: rbt@rbt.ca, dror@zapatec.com
  Subject: Re: Speeding up Aggregates
  In-Reply-To: <1065219071.91586.11.camel@jester>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox