Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7F27C476073 for ; Thu, 17 Oct 2002 04:30:02 -0400 (EDT) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by postgresql.org (Postfix) with ESMTP id 19D18475D99 for ; Thu, 17 Oct 2002 04:30:00 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 3.35 #1) id 18262a-000Mu6-0V; Thu, 17 Oct 2002 09:30:00 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id B3E8F16E7E; Thu, 17 Oct 2002 09:27:42 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id E660516E7D; Thu, 17 Oct 2002 09:27:41 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: Keith Gray Subject: Re: Slow performance on MAX(primary_key) Date: Thu, 17 Oct 2002 09:26:52 +0000 User-Agent: KMail/1.4.3 Cc: PostgreSQL Mailing List References: <20021015071628.57518.qmail@web80304.mail.yahoo.com> <200210150923.15822.dev@archonet.com> <3DAE0883.6090709@heart.com.au> In-Reply-To: <3DAE0883.6090709@heart.com.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200210170926.53170.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/191 X-Sequence-Number: 9908 On Thursday 17 Oct 2002 12:46 am, Keith Gray wrote: > Getting MIN() adn MAX() seems fairly trivial to me. > > When is on an index or more importantly Primary > Key it must be a common SQL. > > Would it be possible in the code to look at > the field in MIN() or MAX() and if it is > indexed use a similar method to the suggested > SQL work around? > > Can I help this to happen? Subscribe to pgsql-hackers and talk through a proposed hack there. The=20 developers always seem happy to receive contributions (you've just got to= =20 look at the contrib folder for evidence). --=20 Richard Huxton