Re: true serializability and predicate locking - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: true serializability and predicate locking
Date
Msg-id 4B4359B7020000250002DD52@gw.wicourts.gov
Whole thread Raw
In response to Re: true serializability and predicate locking  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: true serializability and predicate locking  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> wrote:
> Is a full table lock acceptable in the end? If so, then predicate
> locking is just optimization, and we should leave it until later.
I think that the predicate locking will need to be RAM-based to
provide acceptable performance, and that we will need a
multi-granularity approach with granularity promotion which will
include table locks in some situations.
> If not, then reasonably efficient predicate locking is a part of
> the design. We can still leave it until later, but we shouldn't
> call design issues "premature optimization".
Well, technically table locking can be used to provide predicate
locking; it is just way too coarse-grained to be acceptable for
production as the *only* technique.  The optimization phase will
involve many types of optimization, but a lot of it will be
balancing the overhead of finer-grained locks against the higher
rate of false positives with coarser-grained locks.  I really think
that the correct way to view this is to view backing off to
finer-grained resolutions as optimization, albeit absolutely
necessary optimization.
I totally understand the impulse to work on these details up front
-- I'm fighting against such an impulse myself.  I've just convinced
myself, rationally, that such work is better deferred.  On the other
hand, perhaps if I'm working the development path in the wiki page,
it *could* make sense, if you're interested, to look at issues like
this now and get them all documented and ready to go once I get far
enough along -- we could "meet in the middle."
Another interesting thing which crossed my mind (and I should
probably add a section for such things in the wiki) is that, given
the overhead and conflict implications of using table scans in
serializable transactions, we should perhaps try to discourage table
scans from being chosen for those using serializable transactions. 
I figure we can probably fudge this to a workable degree by
adjusting tuple cost GUCs, but if you wanted to think about this
issue in more depth, it might be useful.
-Kevin


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Writeable CTEs
Next
From: Tim Bunce
Date:
Subject: Re: Status of plperl inter-sp calling