X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9E4DFD1CCC5 for ; Thu, 8 Apr 2004 06:46:05 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 54959-03 for ; Thu, 8 Apr 2004 06:46:04 -0300 (ADT) Received: from ebrsrv01.ebravo.it (host166-198.pool21757.interbusiness.it [217.57.198.166]) by svr1.postgresql.org (Postfix) with ESMTP id 5C03BD1BAF7 for ; Thu, 8 Apr 2004 06:46:02 -0300 (ADT) Received: from streppone.it ([192.168.11.103]) (authenticated bits=0) by ebrsrv01.ebravo.it (8.12.1/8.12.5) with ESMTP id i389k2j4007706 for ; Thu, 8 Apr 2004 11:46:02 +0200 Message-ID: <40751ED5.1010208@streppone.it> Date: Thu, 08 Apr 2004 11:43:49 +0200 From: Cosimo Streppone User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: select count(*) on large tables Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/104 X-Sequence-Number: 6404 Hello, I've followed the last discussion about the particular case of "select count(*)"s on large tables being somewhat slow. I've seen also this issue already on the todo list, so I know it is not a simple question. This problem arises for me on very large tables, which I mean starting from 1 million rows and above. The alternative solution I tried, that has an optimal speed up, unfortunately is not a way out, and it is based on "EXPLAIN SELECT count(*)" output parsing, which is obviously *not* reliable. The times always get better doing a vacuum (and eventually reindex) of the table, and they slowly lower again. Is there an estimate time for this issue to be resolved? Can I help in some way (code, test cases, ...)? -- Cosimo