Re: Tuning/performance question.

From: Dennis Gearon <gearond(at)fireserve(dot)net>
To: holger(at)marzen(dot)de
Cc: David Griffiths <dgriffiths(at)boats(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Tuning/performance question.
Date: 2003-09-28 18:21:00
Message-ID: 3F77268C.7040609@fireserve.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

Holger Marzen wrote:

>On Sat, 27 Sep 2003, David Griffiths wrote:
>
>
>
>>We are doing some performance testing among various databases (Oracle, MySQL
>>and Postgres).
>>
>>One of the queries is showing Postgres lagging quite a bit:
>>
>>SELECT count(*)
>>FROM commercial_entity, country, user_account, address_list
>>LEFT JOIN state_province ON address_list.state_province_id =
>>state_province.state_province_id
>>LEFT JOIN contact_info ON address_list.contact_info_id =
>>contact_info.contact_info_id
>>WHERE address_list.address_type_id = 101
>>AND commercial_entity.commercial_entity_id =
>>address_list.commercial_entity_id
>>AND address_list.country_id = country.country_id
>>AND commercial_entity.user_account_id = user_account.user_account_id
>>AND user_account.user_role_id IN (101, 101);
>>
>>
>
>I guess that this question has been discussed very often - but I cannot
>remember why exactly. Is there a pointer to a technical explanation? Has
>it something to do with MVCC? But ist it one of MVCC's benefits that we
>can make a consistent online backup without archiving redo locks (Oracle
>can't, DB2 can). Is DB2 slower than Oracle in such cases (count(*)) as
>well?
>
>Workaround:
>We can sometimes fake a bit to avoid such costly queries and set up a
>trigger that calls a function that increases a counter in a separate
>counter table. Then we are lightning-fast.
>
>But many users compain about PostgreSQL's poor count(*) performance,
>that's true and can be critical when someone wants to replace another
>database product by PostgreSQL.
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>
Yup, it'd be nice to have faster count(*) performance.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-09-28 18:29:01 Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Previous Message Jim C. Nasby 2003-09-28 17:08:05 Re: Rewriting pg_upgrade (was Re: State of Beta 2)

Browse pgsql-performance by date

  From Date Subject
Next Message Palle Girgensohn 2003-09-28 20:54:41 avoiding seqscan?
Previous Message David Griffiths 2003-09-28 17:02:13 Re: Tuning/performance question.