Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 694C29FB5A6 for ; Tue, 23 Jan 2007 06:53:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 22495-02 for ; Tue, 23 Jan 2007 06:53:38 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by postgresql.org (Postfix) with ESMTP id 62EA19FB298 for ; Tue, 23 Jan 2007 06:53:38 -0400 (AST) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1H9JHU2vvV-0004cO; Tue, 23 Jan 2007 11:53:36 +0100 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1H9JHT-0000BS-00 for pgsql-performance@postgresql.org; Tue, 23 Jan 2007 11:53:35 +0100 Date: Tue, 23 Jan 2007 11:53:35 +0100 From: "A. Kretschmer" To: pgsql-performance@postgresql.org Subject: Re: slow result Message-ID: <20070123105335.GD24927@a-kretschmer.de> References: <5.0.2.1.2.20070123113422.00d189e8@pop.univ-montp2.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.0.2.1.2.20070123113422.00d189e8@pop.univ-montp2.fr> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Provags-ID2: V01U2FsdGVkX1/PwME8EVqy98RNX4TDXSJ+eMglejkbfm0MJc8pLm/NlXsPCWUtjCyMUo3g8xunnjPo3Z2pbkpXdiRnFONs82ZkEehke/CKc7W6MAxWBykj+j8HDLqF1Q+k X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/341 X-Sequence-Number: 22942 am Tue, dem 23.01.2007, um 11:34:52 +0100 mailte Laurent Manchon folgendes: > Hi, > > I have a slow response of my PostgreSQL database 7.4 using this query below > on a table with 800000 rows: > > select count(*)from tbl; If i remember correctly, i saw this question yesterday on an other list... Answer: Because PG force a sequencial scan. You can read a lot about this in the archives. Here some links to explanations: http://www.pervasive-postgres.com/instantkb13/article.aspx?id=10117&cNode=0T1L6L http://sql-info.de/postgresql/postgres-gotchas.html#1_7 http://www.varlena.com/GeneralBits/49.php Hope that helps, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net