X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6C6F9D1B523 for ; Sun, 5 Oct 2003 19:11:56 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 90110-06 for ; Sun, 5 Oct 2003 16:11:11 -0300 (ADT) Received: from mail.hive.nj2.inquent.com (mc.carriermail.com [205.178.180.9]) by svr1.postgresql.org (Postfix) with SMTP id 3FE54D1B515 for ; Sun, 5 Oct 2003 16:11:09 -0300 (ADT) Received: (qmail 22647 invoked from network); 5 Oct 2003 19:11:25 -0000 Received: from unknown (HELO ?192.168.1.199?) (134.22.136.235) by 205.178.180.9 with SMTP; 5 Oct 2003 19:11:25 -0000 Subject: Re: count(*) slow on large tables From: Rod Taylor To: Josh Berkus Cc: Bruce Momjian , Tom Lane , Christopher Browne , Postgresql Performance In-Reply-To: <200310051157.21555.josh@agliodbs.com> References: <200310041819.h94IJkV07596@candle.pha.pa.us> <200310051157.21555.josh@agliodbs.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-XTNXnIGcdPFIprcvprBw" Message-Id: <1065381109.23288.196.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sun, 05 Oct 2003 15:11:50 -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/161 X-Sequence-Number: 3909 --=-XTNXnIGcdPFIprcvprBw Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > And for those GUIs, wouldn't it be 97% as good to run an ANALYZE and give= the=20 > approximate record counts for large tables? Interfaces which run a COUNT(*) like that are broken by design. They fail to consider the table may really be a view which of course could not be cached with results like that and may take days to load a full result set (we had some pretty large views in an old billing system). --=-XTNXnIGcdPFIprcvprBw Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/gGz16DETLow6vwwRAtTVAJ0ZiggnYaltbSqjZvpmgT3dVUzQjwCfaSbx XJVaUzgB8PiM5ozyY7P6LuA= =ljMF -----END PGP SIGNATURE----- --=-XTNXnIGcdPFIprcvprBw--