count(*) using index scan in "query often, update rarely" environment

Поиск
Список
Период
Сортировка
От Cestmir Hybl
Тема count(*) using index scan in "query often, update rarely" environment
Дата
Msg-id 935801c5cb20$dcf93a00$131fc39e@stratos
обсуждение исходный текст
Ответы Re: count(*) using index scan in "query often, update rarely" environment  (hubert depesz lubaczewski <depesz@gmail.com>)
Re: count(*) using index scan in "query often, update rarely" environment  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
Re: count(*) using index scan in "query often, update rarely" environment  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Hello all
 
First of all, I do understand why pgsql with it's MVCC design has to examine tuples to evaluate "count(*)" and "count(*) where (...)" queries in environment with heavy concurrent updates.
 
This kind of usage IMHO isn't the average one. There are many circumstances with rather "query often, update rarely" character.
 
Isn't it possible (and reasonable) for these environments to keep track of whether there is a transaction in progress with update to given table and if not, use an index scan (count(*) where) or cached value (count(*)) to perform this kind of query?
 
(sorry for disturbing if this was already discussed)
 
Regards,
 
Cestmir Hybl

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Need Some Suggestions
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: count(*) using index scan in "query often, update rarely" environment