Re: more problems with count(*) on large table - Mailing list pgsql-general

From Alban Hertroys
Subject Re: more problems with count(*) on large table
Date
Msg-id 4700AF3A.7020208@magproductions.nl
Whole thread Raw
In response to Re: more problems with count(*) on large table  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: more problems with count(*) on large table  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
List pgsql-general
A. Kretschmer wrote:
> Again: an index can't help! Because of MVCC: 'select count(*)' without
> WHERE-condition forces an seq. table-scan.

That has very little to do with MVCC.

If I understand correctly, MVCC is about the availability of records in
the current transaction. For that it makes no difference whether a seq
scan or an index scan is performed - both cases need to check at the
record level whether it's visible (where the seq scan is already looking
at the actual record, of course).

The only difference MVCC makes here is that the balance between a seq
scan or an index scan being more efficient is somewhat sooner in favour
of the seq scan than on some other databases, because the index scan
needs to look at the actual record for visibility.

I pleed not guilty ;)

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: pere roca
Date:
Subject: COPY for .CSV files problem
Next
From: Alban Hertroys
Date:
Subject: Re: more problems with count(*) on large table