Re: more problems with count(*) on large table

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: more problems with count(*) on large table
Дата
Msg-id 4700AF3A.7020208@magproductions.nl
обсуждение исходный текст
Ответ на Re: more problems with count(*) on large table  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Ответы Re: more problems with count(*) on large table  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список 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 по дате отправления:

Предыдущее
От: pere roca
Дата:
Сообщение: COPY for .CSV files problem
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: more problems with count(*) on large table