X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6C70E8B9CA0 for ; Tue, 1 Feb 2005 13:34:06 +0000 (GMT) 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 74116-07 for ; Tue, 1 Feb 2005 13:33:54 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 3791B8B9CD1 for ; Tue, 1 Feb 2005 13:33:56 +0000 (GMT) Received: (qmail 3390 invoked from network); 1 Feb 2005 14:34:17 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 1 Feb 2005 14:34:17 +0100 To: "Andrew Mayo" , pgsql-performance@postgresql.org Subject: Re: Performance of count(*) on large tables vs SQL Server References: <20050201124143.43977.qmail@web206.biz.mail.re2.yahoo.com> Message-ID: Date: Tue, 01 Feb 2005 14:36:30 +0100 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <20050201124143.43977.qmail@web206.biz.mail.re2.yahoo.com> User-Agent: Opera M2/7.54 (Linux, build 751) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/17 X-Sequence-Number: 10346 > clause will be a cheap query - and use it to test if > a table is empty, for instance. (because for > Oracle/Sybase/SQL Server, count(*) is cheap). To test if a table is empty, use a SELECT EXISTS or whatever SELECT with a LIMIT 1...