Re: vacuum, performance, and MVCC

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: vacuum, performance, and MVCC
Дата
Msg-id 200606251824.k5PIO2f21011@momjian.us
обсуждение исходный текст
Ответ на Re: vacuum, performance, and MVCC  (Jan Wieck <JanWieck@Yahoo.com>)
Ответы Re: vacuum, performance, and MVCC  (Jan Wieck <JanWieck@Yahoo.com>)
Re: vacuum, performance, and MVCC  (Hannu Krosing <hannu@skype.net>)
Список pgsql-hackers
Jan Wieck wrote:
> >> Sure, but index reuse seems a lot easier, as there is nothing additional
> >> to remember or clean out when doing it.
> > 
> > Yes, seems so.  TODO added:
> > 
> >     * Reuse index tuples that point to heap tuples that are not visible to
> >       anyone?
> > 
> >> When reusing a heap tuple you have to clean out all index entries
> >> pointing to it.
> > 
> > Well, not for UPDATE for no key changes on the same page, if we do that.
> > 
> 
> An update that results in all the same values of every indexed column of 
> a known deleted invisible tuple. This reused tuple can by definition not 
> be the one currently updated. So unless it is a table without a primary 
> key, this assumes that at least 3 versions of the same row exist within 
> the same block. How likely is that to happen?

Good question.  You take the current tuple, and make another one on the
same page.  Later, an update can reuse the original tuple if it is no
longer visible to anyone (by changing the item id), so you only need two
tuples, not three.  My hope is that a repeated update would eventually
move to a page that enough free space for two (or more) versions.

Does that help explain it?

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: vacuum, performance, and MVCC
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: vacuum, performance, and MVCC