Skip site navigation (1) Skip section navigation (2)

Re: Performance of count(*)

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Andreas Kostyrka <andreas(at)kostyrka(dot)org>
Cc: Andreas Tille <tillea(at)rki(dot)de>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance of count(*)
Date: 2007-03-22 14:37:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Thu, Mar 22, 2007 at 01:29:46PM +0100, Andreas Kostyrka wrote:
> * Andreas Tille <tillea(at)rki(dot)de> [070322 13:24]:
> > Well, to be honest I'm not really interested in the performance of
> > count(*).  I was just discussing general performance issues on the
> > phone line and when my colleague asked me about the size of the
> > database he just wonderd why this takes so long for a job his
> > MS-SQL server is much faster.  So in principle I was just asking
> > a first question that is easy to ask.  Perhaps I come up with
> > more difficult optimisation questions.
> Simple. MSSQL is optimized for this case, and uses "older"
> datastructures. PG uses a MVCC storage, which is not optimized for
> this usecase. It's quite fast for different kinds of queries.

Ask about performing concurrent selects, inserts, updates, and
deletes in SQL Server and about the implications on ACID of locking
hints such as NOLOCK.  Then consider how MVCC handles concurrency
without blocking or the need for dirty reads.

Michael Fuhr

In response to

pgsql-performance by date

Next:From: Michael StoneDate: 2007-03-22 14:41:51
Subject: Re: Performance of count(*)
Previous:From: RonDate: 2007-03-22 14:37:04
Subject: Re: Lower Random Access Time vs RAID 0 / 1

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group