Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: clustering ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 15 Topic 15434 of 17602
Post > Topic >>

Re: clustering without locking

by craig@[EMAIL PROTECTED] (Craig Ringer) May 4, 2008 at 03:04 AM

Tom Lane wrote:

> Anyway I think the main practical problem would be with deadlocks
> against other transactions trying to update/delete tuples at the same
> times you need to move them.  Dealing with uncommitted insertions would
> be tricky too --- I think you'd need to wait out the inserting
> transaction, which would add more possibilities of deadlock.

I really appreciate your taking the time to think about and explain 
this. It's very helpful, as I'm trying to understand some of the basics 
of PostgreSQL's underlying operation.

I'd completely missed thinking about uncomitted inserts - I never 
normally need to think about them so they just didn't cross my mind. I 
guess it'd either have to do the equivalent of a SELECT FOR UPDATE 
NOWAIT on all tuples in the pages to be freed before doing anything 
else, or would have to take out an EXCLUSIVE table lock while freeing a 
chunk of pages.

I can also vaguely see how problems would arise with concurrent 
multi-tuple updates grabbing locks in a different order to the 
progressive cluster and deadlocking, and again hadn't even thought about 
that.

I guess it might be OK if the progressive cluster attempted to get row 
exclusive locks on all tuples in the contiguous range of pages to be 
freed, and if it failed to get even one it released them all and retried 
that whole step. It sounds like it could be slow and inefficient, 
though, possibly so much so as to defeat the point of the clustering 
operation in the first place.

Thanks again for taking the time to go over that - it's extremely 
helpful and much appreciated.

--
Craig Ringer

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 15 Posts in Topic:
clustering without locking
fschmidt@[EMAIL PROTECTED  2008-05-01 17:12:52 
Re: clustering without locking
kleptog@[EMAIL PROTECTED]  2008-05-02 08:18:39 
Re: clustering without locking
scott_ribe@[EMAIL PROTECT  2008-05-02 07:51:57 
Re: clustering without locking
craig@[EMAIL PROTECTED]   2008-05-02 22:09:01 
Re: clustering without locking
scott_ribe@[EMAIL PROTECT  2008-05-02 08:29:28 
Re: clustering without locking
craig@[EMAIL PROTECTED]   2008-05-03 08:21:43 
Re: clustering without locking
tgl@[EMAIL PROTECTED] (T  2008-05-02 20:41:35 
Re: clustering without locking
craig@[EMAIL PROTECTED]   2008-05-03 09:53:55 
Re: clustering without locking
tgl@[EMAIL PROTECTED] (T  2008-05-03 13:27:14 
Re: clustering without locking
craig@[EMAIL PROTECTED]   2008-05-04 02:19:14 
Re: clustering without locking
tgl@[EMAIL PROTECTED] (T  2008-05-03 14:33:18 
Re: clustering without locking
craig@[EMAIL PROTECTED]   2008-05-04 03:04:56 
Re: clustering without locking
tgl@[EMAIL PROTECTED] (T  2008-05-02 10:51:07 
Re: clustering without locking
scott_ribe@[EMAIL PROTECT  2008-05-02 09:08:41 
Re: clustering without locking
masao.fujii@[EMAIL PROTEC  2008-05-02 16:11:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:03:41 CST 2008.