Re: I/O on select count(*)

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема Re: I/O on select count(*)
Дата
Msg-id 2e78013d0805141940x50c3f51u439019e8e592959@mail.gmail.com
обсуждение исходный текст
Ответ на Re: I/O on select count(*)  (Greg Smith <gsmith@gregsmith.com>)
Ответы Re: I/O on select count(*)  (Luke Lonergan <llonergan@greenplum.com>)
Re: I/O on select count(*)  (Greg Smith <gsmith@gregsmith.com>)
Список pgsql-performance
On Thu, May 15, 2008 at 7:51 AM, Greg Smith <gsmith@gregsmith.com> wrote:
>
>
> So is vacuum helpful here because it will force all that to happen in one
> batch?  To put that another way:  if I've run a manual vacuum, is it true
> that it will have updated all the hint bits to XMIN_COMMITTED for all the
> tuples that were all done when the vacuum started?
>

Yes. For that matter, even a plain SELECT or count(*) on the entire
table is good enough. That will check every tuple for visibility and
set it's hint bits.

Another point to note is that the hint bits are checked and set on a
per tuple basis. So especially during index scan, the same heap page
may get rewritten many times. I had suggested in the past that
whenever we set hint bits for a tuple, we should check all other
tuples in the page and set their hint bits too to avoid multiple
writes of the same page. I guess the idea got rejected because of lack
of benchmarks to prove the benefit.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com

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

Предыдущее
От: "Jan de Visser"
Дата:
Сообщение: Re: I/O on select count(*)
Следующее
От: Luke Lonergan
Дата:
Сообщение: Re: I/O on select count(*)