Re: heap vacuum & cleanup locks

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: heap vacuum & cleanup locks
Дата
Msg-id 4DEC7B90.6000709@enterprisedb.com
обсуждение исходный текст
Ответ на Re: heap vacuum & cleanup locks  (Jim Nasby <jim@nasby.net>)
Ответы Re: heap vacuum & cleanup locks  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On 06.06.2011 09:35, Jim Nasby wrote:
> I've had a related idea that I haven't looked into... if you're scanning a relation (ie: index scan, seq scan) I've
wonderedif it would be more efficient to deal with the entire page at once, possibly be making a copy of it. This would
reducethe number of times you pin the page (often quite dramatically). I realize that means copying the entire page,
butI suspect that would occur entirely in the L1 cache, which would be fast.
 

We already do that. When an index scan moves to an index page, the heap 
tid pointers of all the matching index tuples are copied to 
backend-private memory in one go, and the lock is released. And for a 
seqscan, the visibility of all the tuples on the page is checked in one 
go while holding the lock, then the lock is released but the pin is 
kept. The pin is only released after all the tuples have been read. 
There's no repeated pin-unpin for each tuple.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: reducing the overhead of frequent table locks - now, with WIP patch
Следующее
От: Cyan Ogilvie
Дата:
Сообщение: WIP: AuthenticationMD5 protocol documentation clarification