Re: Need help understanding pg_locks

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Need help understanding pg_locks
Date: 2011-07-13 16:07:31
Message-ID: 201107131607.p6DG7VH27321@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Florian Pflug wrote:
> On Jul13, 2011, at 17:44 , Tom Lane wrote:
> > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> >> OK, I went with this wording, using "lock object is on" terminology.
> >> Applied patch attached --- adjustments welcomed.
> >
> > I think you misunderstood the suggestion. This is not an improvement,
> > it's just more confusion.
>
> FWIW, I agree. First, "lock object" seems redundant - you might just as
> well say simply "lock". This is different from "locked object" - there,
> the noun "object" servers as a dummy that gives the adjective "locked"
> something to refer to.

I would personally prefer "lock" rather than "lock object".

> Also, it now sounds as if we were talking about the storage
> location of the lock (as an entity in itself) in some of the sentences.
>
> Here's an example
>
> "Page number within the relation, or null if the lock object
> is not on a tuple or relation page".
>
> To me at least, that sounds as if the lock might somehow be stored
> on a "relation page".
>
> Maybe "on" is still too generic. What if we said "protects" instead?
> That makes the intended relationship between the lock and the
> tuple/relation/... much clearer. We'd then say
>
> (A)
> "Protected page number within the relation, or null if the lock
> does not protect a tuple or relation page".
>
> Another possibility is to make the relationship clearer by adding
> the adjective "locked" before the locked thing, as in
>
> (B)
> "Locked page number within the relation, or null if the lock
> is not on a tuple or relation page".

Yes, I like this --- putting the "Locked at the front". The old code
says things like "Page number within the relation" which is kind of
generic.

>
> The latter also works "lock .. on .. " with
> "locked object ... is ...", i.e.
>
> (C)
> "Locked page number within the relation, or null if the locked object
> is not a tuple or relation page".
>
> We could also get rid of the noun completely by saying
>
> (D)
> "Locked page number within the relation, or null if it isn't
> a tuple or relation page that is locked".

>
> I personally slightly favor (D).

Me too. Others?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2011-07-13 16:20:11 Re: Full GUID support
Previous Message Florian Pflug 2011-07-13 16:05:17 Re: Need help understanding pg_locks