X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C674BD1B552 for ; Fri, 3 Oct 2003 23:32:22 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 67628-10 for ; Fri, 3 Oct 2003 20:31:35 -0300 (ADT) Received: from mail.hive.nj2.inquent.com (mc.carriermail.com [205.178.180.9]) by svr1.postgresql.org (Postfix) with SMTP id 8D07ED1B52E for ; Fri, 3 Oct 2003 20:31:32 -0300 (ADT) Received: (qmail 6397 invoked from network); 3 Oct 2003 23:31:01 -0000 Received: from unknown (HELO ?192.168.1.199?) (134.22.136.235) by 205.178.180.9 with SMTP; 3 Oct 2003 23:31:01 -0000 Subject: Re: Speeding up Aggregates From: Rod Taylor To: Dror Matalon Cc: Postgresql Performance In-Reply-To: <20031003215347.GQ87525@rlx11.zapatec.com> References: <20031003202120.GO87525@rlx11.zapatec.com> <1065217488.91586.3.camel@jester> <20031003215347.GQ87525@rlx11.zapatec.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-C8vA/RODvCZa9+vFsnJK" Message-Id: <1065219071.91586.11.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 03 Oct 2003 19:32:16 -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/123 X-Sequence-Number: 3871 --=-C8vA/RODvCZa9+vFsnJK Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > > I hope it isn't the first or second one ;) >=20 > CREATE or REPLACE FUNCTION item_max_date (int4, varchar) RETURNS > timestamptz AS ' > select max(dtstamp) from items where channel =3D $1 and link =3D $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 =3D $1 and link =3D $2; ' LANGUAGE 'sql' STABLE; --=-C8vA/RODvCZa9+vFsnJK Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/ffP/6DETLow6vwwRAkVWAJ0U2oP+O0Bvt/HwGSyuvqq7xOFRcgCfQbhu GpVTkMQb/IMIrXOG/2SqL/c= =1Pq1 -----END PGP SIGNATURE----- --=-C8vA/RODvCZa9+vFsnJK--