Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id DEEDC9FA081 for ; Thu, 1 Nov 2007 12:47:46 -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 61982-05 for ; Thu, 1 Nov 2007 12:47:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [62.232.55.118]) by postgresql.org (Postfix) with ESMTP id ACB659FA186 for ; Thu, 1 Nov 2007 12:47:34 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1IncGa-00052o-LO; Thu, 01 Nov 2007 15:47:32 +0000 To: "Palle Girgensohn" Cc: "Tom Lane" , Subject: Re: select max(field) from table much faster with a group by clause? In-Reply-To: (Palle Girgensohn's message of "Thu\, 01 Nov 2007 15\:36\:29 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.performance" 3054) References: <4305.1193924619@sss.pgh.pa.us> From: Gregory Stark Organization: EnterpriseDB Date: Thu, 01 Nov 2007 15:47:32 +0000 Message-ID: <873avqrmqz.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/20 X-Sequence-Number: 27435 "Palle Girgensohn" writes: > Are there any other things I can modify? You might consider an index on . Keep in mind that every new index imposes an incremental cost on every update and insert and increases the time for vacuum. > max_prepared_transactions = 100 # can be 0 or more Are you actually using prepared transactions (are you synchronising multiple databases using a transaction manager)? If not then set this to 0 as it takes some resources. > maintenance_work_mem = 16384 # min 1024, size in KB Raising this might decrease vacuum times if that's a problem. > fsync = off You realize that this means if the system loses power or the kernel crashes you could have data corruption? Do you take very frequent backups or can you reconstruct your data? -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication support!