Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 55F3B4762DC for ; Tue, 15 Oct 2002 01:04:42 -0400 (EDT) Received: from gateway.heart.com.au (202-44-184-121.nexnet.net.au [202.44.184.121]) by postgresql.org (Postfix) with ESMTP id 7D7F047627C for ; Tue, 15 Oct 2002 01:04:39 -0400 (EDT) Received: from tardis.heart.com.au (IDENT:root@tardis.heart.com.au [192.168.0.42]) by gateway.heart.com.au (8.11.6/8.11.2) with ESMTP id g9F5f7I27831 for ; Tue, 15 Oct 2002 15:41:12 +1000 Received: from heart.com.au ([192.168.0.53]) by tardis.heart.com.au (8.9.3/8.8.7) with ESMTP id PAA04680 for ; Tue, 15 Oct 2002 15:04:06 +1000 Message-ID: <3DABA146.7010902@heart.com.au> Date: Tue, 15 Oct 2002 15:01:58 +1000 From: Keith Gray User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: en-us MIME-Version: 1.0 To: SQL PostgreSQL Subject: Slow performance on MAX(primary_key) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/150 X-Sequence-Number: 9867 Help, I have just been comparing some large table performance under 7.1 using the select max(primary key)from table; We are using this for various functions including sequence. It is taking 9 seconds to return this from around 1 million records. Shouldn't this be an instantaneous lookup? -- Keith Gray Technical Services Manager Heart Consulting Services