Re: Improving count(*)

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: Improving count(*)
Дата
Msg-id 1132257309.50945.78.camel@home
обсуждение исходный текст
Ответ на Re: Improving count(*)  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Improving count(*)  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
On Thu, 2005-11-17 at 20:38 +0100, Martijn van Oosterhout wrote:
> On Thu, Nov 17, 2005 at 07:28:10PM +0000, Simon Riggs wrote:
> > One of the major complaints is always "Select count(*) is slow".
> > 
> > I have a somewhat broadbrush idea as to how we might do this (for larger
> > tables). 
> 
> It's an interesting idea, but you still run into the issue of
> visibility. If two people start a transaction, one of them inserts a
> row and then both run a select count(*), they should get different
> answers. I just don't see a way that your suggestion could possibly
> lead to that result...

The instant someone touches a block it would no longer be marked as
frozen (vacuum or analyze or other is not required) and count(*) would
visit the tuples in the block making the correct decision at that time.

-- 



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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: [ADMIN] ERROR: could not read block
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: [ADMIN] ERROR: could not read block