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 16E7ED1B4FE for ; Fri, 3 Oct 2003 21:45:31 +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 53047-01 for ; Fri, 3 Oct 2003 18:44:42 -0300 (ADT) Received: from mail.hive.nj2.inquent.com (mc.carriermail.com [205.178.180.9]) by svr1.postgresql.org (Postfix) with SMTP id 864F7D1B503 for ; Fri, 3 Oct 2003 18:44:24 -0300 (ADT) Received: (qmail 29344 invoked from network); 3 Oct 2003 21:43:37 -0000 Received: from unknown (HELO ?192.168.1.199?) (134.22.136.235) by 205.178.180.9 with SMTP; 3 Oct 2003 21:43:37 -0000 Subject: Re: Speeding up Aggregates From: Rod Taylor To: Dror Matalon Cc: Postgresql Performance In-Reply-To: <20031003202120.GO87525@rlx11.zapatec.com> References: <20031003202120.GO87525@rlx11.zapatec.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-FSO74Jbo4HfsFxOvk4Gn" Message-Id: <1065217488.91586.3.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 03 Oct 2003 17:44:49 -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/110 X-Sequence-Number: 3858 --=-FSO74Jbo4HfsFxOvk4Gn Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > item_max_date() looks like this: > select max(dtstamp) from items where channel =3D $1 and link =3D $2; It is too bad the (channel, link) index doesn't have dtstamp at the end of it, otherwise the below query would be a gain (might be a small one anyway). select dtstamp from items where channel =3D $1 and link =3D $2 ORDER BY dtstamp DESC LIMIT 1; Could you show us the exact specification of the function? In particular, did you mark it VOLATILE, IMMUTABLE, or STABLE? I hope it isn't the first or second one ;) --=-FSO74Jbo4HfsFxOvk4Gn 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/fe3Q6DETLow6vwwRAqeBAJ9r8F2NU9iBv4PMHWFH2HiYPV3q7wCfWes8 B/GSfsD/XGNFe+8lZhIRH4M= =XQSG -----END PGP SIGNATURE----- --=-FSO74Jbo4HfsFxOvk4Gn--