Re: Bug: Buffer cache is not scan resistant

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug: Buffer cache is not scan resistant
Дата
Msg-id 20896.1173120946@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Bug: Buffer cache is not scan resistant  ("Pavan Deolasee" <pavan@enterprisedb.com>)
Список pgsql-hackers
"Pavan Deolasee" <pavan@enterprisedb.com> writes:
> I am wondering whether seqscan would set the usage_count to 1 or to a higher
> value. usage_count is  incremented while unpinning the buffer. Even if 
> we use
> page-at-a-time mode, won't the buffer itself would get pinned/unpinned
> every time seqscan returns a tuple ? If thats the case, the overhead would
> be O(BM_MAX_USAGE_COUNT * N) for every N reads.

No, it's only once per page.  There's a good deal of PrivateRefCount
thrashing that goes on while examining the individual tuples, but the
shared state only changes when we leave the page, because we hold pin
continuously on the current page of a seqscan.  If you don't believe
me, insert some debug printouts for yourself.

> How about smaller value for BM_MAX_USAGE_COUNT ?

This is not relevant to the problem: we are concerned about usage count
1 versus 0, not the other end of the range.
        regards, tom lane


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

Предыдущее
От: "Pavan Deolasee"
Дата:
Сообщение: Re: Bug: Buffer cache is not scan resistant
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Bug: Buffer cache is not scan resistant