Re: Idea for cleaner representation of snapshots

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Idea for cleaner representation of snapshots
Date: 2007-03-24 20:21:44
Message-ID: 20070324202144.GB1089@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 24, 2007 at 02:00:30PM -0400, Tom Lane wrote:
> I had an idea about how to make this cleaner and faster at
> the same time. Make all snapshots be real pointers to
> SnapshotData structures (except InvalidSnapshot, which remains
> an alias for NULL). Add a struct field that is a pointer to
> the satifies function for the snapshot type. Then
> HeapTupleSatisfiesVisibility reduces to something like
>
> ((*(snapshot)->satisfies) ((tuple)->t_data, snapshot, buffer))
>
> which ought to be faster than it is now. We could also add
> an "mvcc" bool field to simplify IsMVCCSnapshot() --- or just
> make it test the contents of the satisfies-function field.

Sounds like a winner. Essentially snapshots becomes objects that have
methods you can use to interact with them. Make a new shapshot type,
most of the code doesn't need to care.

So yep, good idea.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-24 21:15:05 Re: Idea for cleaner representation of snapshots
Previous Message Jim Nasby 2007-03-24 18:25:34 Re: Limiting user connnections on 7.4