Re: Make COUNT(*) Faster?

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Make COUNT(*) Faster?
Дата
Msg-id 20050708153100.GC21449@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на Re: Make COUNT(*) Faster?  (Steve Wampler <swampler@noao.edu>)
Список pgsql-sql
On Fri, Jul 08, 2005 at 08:07:27AM -0700, Steve Wampler wrote:
> Bruno Wolff III wrote:
> > No, it is an exact count.
> 
> Yes, for the transaction, but it's an approximation of the number of
> tuples in the table - which is probably what the people who worry about
> its cost are more interested in (an approximate count for the table).

You seem to have the wrong idea of "tuples in the table" here.  You
need to think harder about MVCC visibility rules.  Given MVCC,
there isn't really a "view from nowhere" in the system -- there's
just the idea of what tuple visibility.  For a little more, you might
want to look at the presentation Tom Lane made for this:

http://www.postgresql.org/files/developer/transactions.pdf

A  

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
A certain description of men are for getting out of debt, yet are
against all taxes for raising money to pay it off.    --Alexander Hamilton


В списке pgsql-sql по дате отправления:

Предыдущее
От: Dawid Kuroczko
Дата:
Сообщение: Re: Make COUNT(*) Faster?
Следующее
От: Dawid Kuroczko
Дата:
Сообщение: Re: Make COUNT(*) Faster?