From: Michael Stone <mstone+postgres@mathom.us>
To: pgsql-performance@postgresql.org
Subject: Re: Performance of count(*)
Date: Thu, 22 Mar 2007 10:18:10 -0400
Message-ID: <20070322141807.GE11402@mathom.us> (raw)
In-Reply-To: <Pine.LNX.4.64.0703221323590.1503@ismoli.solenovo.jns>
References: <Pine.LNX.4.62.0703221149210.13747@wr-linux02>
<200703221208.19358.albert@sedifa.com>
<Pine.LNX.4.64.0703221323590.1503@ismoli.solenovo.jns>
On Thu, Mar 22, 2007 at 01:30:35PM +0200, ismo.tuononen@solenovo.fi wrote:
>approximated count?????
>
>why? who would need it? where you can use it?
Do a google query. Look at the top of the page, where it says
"results N to M of about O". For user interfaces (which is where a lot
of this count(*) stuff comes from) you quite likely don't care about the
exact count, because the user doesn't really care about the exact count.
IIRC, that's basically what you get with the mysql count anyway, since
there are corner cases for results in a transaction. Avoiding those
cases is why the postgres count takes so long; sometimes that's what's
desired and sometimes it is not.
Mike Stone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mstone+postgres@mathom.us
Subject: Re: Performance of count(*)
In-Reply-To: <20070322141807.GE11402@mathom.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox