Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A504B9FB585 for ; Thu, 22 Mar 2007 13:20:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 98145-02 for ; Thu, 22 Mar 2007 13:20:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from relay.icomedias.com (relay.icomedias.com [62.99.232.66]) by postgresql.org (Postfix) with ESMTP id 032D69FBA6C for ; Thu, 22 Mar 2007 13:20:10 -0300 (ADT) Received: from loki.icomedias.com ([10.192.17.128]) by relay.icomedias.com (8.13.7/8.13.7) with ESMTP id l2MGK2Nx001505; Thu, 22 Mar 2007 17:20:05 +0100 From: Mario Weilguni To: Andreas Kostyrka Subject: Re: Performance of count(*) Date: Thu, 22 Mar 2007 17:20:02 +0100 User-Agent: KMail/1.9.5 Cc: pgsql-performance@postgresql.org, "Jonah H. Harris" , Merlin Moncure , Andreas Tille References: <200703221536.32575.mweilguni@sime.com> <20070322151714.GA11448@andi-lap.la.revver.com> In-Reply-To: <20070322151714.GA11448@andi-lap.la.revver.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200703221720.02450.mweilguni@sime.com> X-Scanned-By: MIMEDefang 2.57 on 10.192.64.104 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/337 X-Sequence-Number: 23742 Am Donnerstag, 22. M=C3=A4rz 2007 16:17 schrieb Andreas Kostyrka: > * Mario Weilguni [070322 15:59]: > > Am Donnerstag, 22. M=C3=A4rz 2007 15:33 schrieb Jonah H. Harris: > > > On 3/22/07, Merlin Moncure wrote: > > > > As others suggest select count(*) from table is very special case > > > > which non-mvcc databases can optimize for. > > > > > > Well, other MVCC database still do it faster than we do. However, I > > > think we'll be able to use the dead space map for speeding this up a > > > bit wouldn't we? > > > > Which MVCC DB do you mean? Just curious... > > Well, mysql claims InnoDB to be mvcc ;) Ok, but last time I tried count(*) with InnoDB tables did take roughly(*) t= he=20 same time last time I tried - because InnoDB has the same problem as postgr= es=20 and has to do a seqscan too (I think it's mentioned somewhere in their docs= ). (*) in fact, postgres was faster, but the values were comparable, 40 second= s=20 vs. 48 seconds=20 Maybe the InnoDB have made some progress here, I tested it with MySQL 5.0.1= 8.