Simon Riggs wrote:
> On Thu, 2008-08-07 at 14:18 +0100, Richard Huxton wrote:
>>
>> An attempt to write to user_emails by T0 will fail with an error.
>
> All above correct
>
> The point of doing this is that *if* T0 becomes the oldest transaction
> it will *not* interfere with removal of rows on "user_emails".
>
>> An attempt to read from user_emails by T0 will be allowed?
>
> No, reads must also be excluded otherwise MVCC will be violated.
Ah good - I was wondering, but I read your first email as allowing reads.
>> What happens if I'm in ISOLATION LEVEL SERIALIZABLE? Presumably the read
>> is disallowed then too?
>
> No, that's not relevant. That is your choice about how often you update
> your snapshot of the database. The visibility group refers to the
> *scope* of the snapshot, so the two things are orthogonal.
So - effectively we're partitioning the database into (possibly
overlapping) subsets of tables.
Would it simplify things at all to have a centrally-defined list of
"visibility scopes" (or "groups") which your transaction/user can
access? As a DBA, I'd rather have somewhere central to manage this, and
I'd probably make it per-user anyway.
-- Richard Huxton Archonet Ltd