Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 63D9F9FB1F4 for ; Thu, 1 Nov 2007 12:25:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 13249-02-4 for ; Thu, 1 Nov 2007 12:25:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from melon.pingpong.net (melon.pingpong.net [195.178.174.161]) by postgresql.org (Postfix) with ESMTP id 7D4129F9F92 for ; Thu, 1 Nov 2007 12:25:10 -0300 (ADT) Received: from localhost (localhost.pingpong.net [127.0.0.1]) by melon.pingpong.net (Postfix) with ESMTP id F2BE050924; Thu, 1 Nov 2007 16:25:13 +0100 (CET) Received: from melon.pingpong.net ([127.0.0.1]) by localhost (melon.pingpong.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07510-01-24; Thu, 1 Nov 2007 16:25:13 +0100 (CET) Received: from [192.168.1.187] (unknown [213.136.40.204]) by melon.pingpong.net (Postfix) with ESMTP id C9D1750923; Thu, 1 Nov 2007 16:25:13 +0100 (CET) Date: Thu, 01 Nov 2007 16:25:08 +0100 From: Palle Girgensohn To: Tom Lane cc: pgsql-performance@postgresql.org Subject: Re: select max(field) from table much faster with a group by clause? Message-ID: <16563C7D831BD7B32DFBDDEC@rambutan.pingpong.net> In-Reply-To: <5504.1193929617@sss.pgh.pa.us> References: <4305.1193924619@sss.pgh.pa.us> <5504.1193929617@sss.pgh.pa.us> X-Mailer: Mulberry/4.0.8 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-new at pingpong.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/17 X-Sequence-Number: 27432 --On torsdag, november 01, 2007 11.06.57 -0400 Tom Lane wrote: > Palle Girgensohn writes: >> Unfortunately, altering statistics doesn't help. I see no difference >> when altering the value from 10 (default) to 100, 1000 or 100000. :-( > > Um, you did re-ANALYZE the table after changing the setting? alter table login alter userid SET statistics 1000; vacuum analyze login;