X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 61208DAFE4 for ; Wed, 26 Oct 2005 22:41:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81213-09 for ; Thu, 27 Oct 2005 01:41:49 +0000 (GMT) Received: from houston.familyhealth.com.au (houston.au.fhnetwork.com [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id 7C872DAFC1 for ; Wed, 26 Oct 2005 22:41:51 -0300 (ADT) Received: from houston.familyhealth.com.au (localhost [127.0.0.1]) by houston.familyhealth.com.au (Postfix) with ESMTP id 7D38125072; Thu, 27 Oct 2005 09:41:55 +0800 (WST) Received: from [127.0.0.1] (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (Postfix) with ESMTP id 593EA24FF7; Thu, 27 Oct 2005 09:41:54 +0800 (WST) Message-ID: <436030BC.1000404@familyhealth.com.au> Date: Thu, 27 Oct 2005 09:43:24 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: aurora Cc: pgsql-performance@postgresql.org Subject: Re: browsing table with 2 million records References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-familyhealth-MailScanner-Information: Please contact the ISP for more information X-familyhealth-MailScanner: Found to be clean X-familyhealth-MailScanner-From: chriskl@familyhealth.com.au X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.06 required=5 tests=[AWL=0.010, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/408 X-Sequence-Number: 15176 > We have a GUI that let user browser through the record page by page at > about 25 records a time. (Don't ask me why but we have to have this > GUI). This translates to something like > > select count(*) from table <-- to give feedback about the DB size > select * from table order by date limit 25 offset 0 Heh, sounds like phpPgAdmin...I really should do something about that. > Tables seems properly indexed, with vacuum and analyze ran regularly. > Still this very basic SQLs takes up to a minute run. Yes, COUNT(*) on a large table is always slow in PostgreSQL. Search the mailing lists for countless discussions about it. Chris