Re: Display Pg buffer cache (WIP)

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Display Pg buffer cache (WIP)
Дата
Msg-id 422ABB9D.2050905@samurai.com
обсуждение исходный текст
Ответ на Re: Display Pg buffer cache (WIP)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Display Pg buffer cache (WIP)
Список pgsql-patches
Tom Lane wrote:
> It'd be possible to dispense with the per-buffer spinlocks so long as
> you look only at the tag (and perhaps the TAG_VALID flag bit).  The
> tags can't be changing while you hold the BufMappingLock.

That's what I had thought at first, but this comment in buf_internals.h
dissuaded me: "buf_hdr_lock must be held to examine or change the tag,
flags, usage_count, refcount, or wait_backend_id fields." The comment
already notes this isn't true if you've got the buffer pinned; it would
be worth adding another exception for holding the BufMappingLock, IMHO.

> I'm dubious that there's any point in recording information as
> transient as the refcounts and dirtybits

I think it's worth recording dirty bits -- it provides an indication of
the effectiveness of the bgwriter, for example. Reference counts could
be done away with, although I doubt it would have a significant effect
on the time spent holding the lock.

-Neil

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Cleaning up unreferenced table files
Следующее
От: Neil Conway
Дата:
Сообщение: Re: Display Pg buffer cache (WIP)