Re: Debugging deadlocks

From: Paul Tillotson <pntil(at)shentel(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Debugging deadlocks
Date: 2005-04-02 03:14:07
Message-ID: 424E0DFF.6000702@shentel.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


>>I suppose there must be reasons not to do this, but have you considered
>>using the "slack" space (empty space) in an ordinary table "heap" page
>>to store share-locks on the tuples in that page? (If not enough space
>>is available then you would still need to use the spilled-to-disk btree
>>structure.)
>>
>>
>
>No, I hadn't considered it. However this seems hard to do, because the
>"slack space" does not have a start point; on each page, elements
>(tuples) grow from the back to the front, while element pointers grow
>in the reverse direction. So I don't see how would this be done.
>
>
Would it work for an updater, who finds that the locks list (currently
located in the middle of the empty space) is "in the way" of a new tuple
that he wants to insert, to take some kind of lock, move the whole list
up or down (spilling some of these locks to the disk if no more space is
available), and release it again?

Could the lock(s) on a particular tuple be tacked onto the end of that
tuple? (I think tuples are stored variable-width anyway, aren't they?)
I suppose this is conceptually equivalent to adding a variable width
system column which gets TOASTED when it gets too wide. I suppose this
would make taking a lock as expensive as doing an update, though, right?

Paul Tillotson

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2005-04-02 03:16:16 Re: [HACKERS] plPHP in core?
Previous Message Joshua D. Drake 2005-04-02 03:11:14 plPHP in core?

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-04-02 03:15:51 LEFT JOIN used in psql describe.c
Previous Message Joshua D. Drake 2005-04-02 03:11:14 plPHP in core?