Alvaro Herrera wrote:
>
> Now this can't be applied right away because it's easy to run "out of
> memory" (shared memory for the lock table). Say, a delete or update
> that touches 10000 tuples does not work. I'm currently working on a
> proposal to allow the lock table to spill to disk ...
While not always true, in many cases the cardinality of the referenced
(parent) table is small compared to that of the referencing (child)
table. Does locking require a separate lock record for each tuple in
the child table, or just one for each tuple in the parent table with a
reference count? For example, the scenario I started this thread with
had two child tables referencing rows in a common parent table. For a
given parent tuple, a single "prevent write" lock with a reference count
would seem sufficient.
--
Guy Rouillier