Re: PostgreSQL Gotchas --- count()

From: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>
To: "Jeffrey Melloy" <jmelloy(at)visualdistortion(dot)org>, "Neil Conway" <neilc(at)samurai(dot)com>
Cc: "Aly S(dot)P Dharshi" <aly(dot)dharshi(at)telus(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL Gotchas --- count()
Date: 2005-10-07 00:40:41
Message-ID: 71E37EF6B7DCC1499CEA0316A2568328024BBA31@loki.wc.globexplorer.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Informix however it is blindingly fast, and can also be instantly conjured with the dbaccess tool (Info/Table/Status). They might be stashing this count somewhere, but it is not available when the table is locked, as during a load. However they do it, performance does not seem to suffer, and having this rapidly available is certainly nice. Especially when people are used to it.

Greg Williamson
DBA
GlobeXplorer LLC

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org on behalf of Jeffrey Melloy
Sent: Thu 10/6/2005 3:47 PM
To: Neil Conway
Cc: Aly S.P Dharshi; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] PostgreSQL Gotchas
Neil Conway wrote:

>
>"COUNT(*) very slow": this is a known issue -- see the -hackers archives
>for many prior discussions. MVCC makes this hard to solve effectively
>(whether applications should actually be using COUNT(*) on large tables
>with no WHERE clause is another matter...)
>
>-Neil
>
>
And it's not like a count(*) on an Oracle database of any decently-sized
dataset is blazing fast, or even in blazing's ballpark.

The only thing I could see actually being an issue is the random() one
and add missing from. The rest are trivial. The random() thing is
interesting, esoteric, and probably has never been a problem in a real
situation. (Or has exactly once, when he wrote that gotcha)

Jeff

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

!DSPAM:4345aeea115747915089936!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2005-10-07 02:14:40 Re: PostgreSQL Gotchas --- count()
Previous Message David Fetter 2005-10-07 00:34:06 Re: PostgreSQL 8.1 vs. MySQL 5.0?