Re: Remove xmin and cmin from frozen tuples

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Remove xmin and cmin from frozen tuples
Дата
Msg-id 20050907170552.GA5953@surnet.cl
обсуждение исходный текст
Ответ на Re: Remove xmin and cmin from frozen tuples  ("Jim C. Nasby" <jnasby@pervasive.com>)
Ответы Re: Remove xmin and cmin from frozen tuples  ("Jim C. Nasby" <jnasby@pervasive.com>)
Re: Remove xmin and cmin from frozen tuples  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Sep 07, 2005 at 12:31:01AM -0500, Jim C. Nasby wrote:
> On Tue, Sep 06, 2005 at 07:02:20PM -0400, Tom Lane wrote:
> > "Jim C. Nasby" <jnasby@pervasive.com> writes:
> > > If the 4 header fields in question were just normalized out, wouldn't
> > > all the semantics continue to work the same? All I'm envisioning is
> > > replacing them in each tuple with a pointer (vis_id) to another
> > > datastore that would be roughly equivalent to:
> > 
> > > CREATE TABLE visibility (
> > >     vis_id      SERIAL,
> > >     xmin        int,
> > >     xmax        int,
> > >     cmin        int,
> > >     cmax_xmax   int
> > > )
> > 
> > > Of course you wouldn't use an actual table to do this, but hopefully
> > > this clarifies my idea.

> Well, like I said, I'm not envisioning using a table to store that info.
> Since we'd be storing 4 fixed-length fields, you wouldn't need to
> actually store vis_id per entry, just use the offset into the page.
> Assuming you use one 'slot' to store the id of the first set, you could
> store 511 tuples per page, which doesn't sound very bad.

I think this could be done with our "SLRU" mechanism, just like pg_clog,
pg_subtrans and pg_multixact do.  Whether it's really a good idea or
not, it's another story.  The problem is that you would be creating new
ones all the time, it would become a huge source of contention, and it
would use a lot of memory.

Anyway you are just moving the storage somewhere else -- instead of
having 4 fields in the tuple itself, you have one field which points
the same 4 fields elsewhere.  I don't see how is that a win; it's
actually worse because you have to do two lookups.  (And actually you
have just enlarged the storage requirements because you need to store
the "vis_id" twice.)

-- 
Alvaro Herrera -- Valdivia, Chile         Architect, www.EnterpriseDB.com
"La realidad se compone de muchos sueños, todos ellos diferentes,
pero en cierto aspecto, parecidos..." (Yo, hablando de sueños eróticos)


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: uuid type for postgres
Следующее
От: nathan wagner
Дата:
Сообщение: Re: uuid type for postgres