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 11 of 15 Topic 15434 of 16965
Post > Topic >>

Re: clustering without locking

by tgl@[EMAIL PROTECTED] (Tom Lane) May 3, 2008 at 02:33 PM

Craig Ringer <craig@[EMAIL PROTECTED]
> writes:
> Begin a transaction and free the first chunk (2 tuples in this case, but

> obviously many more in a real case):

> -----------
> ..473612058
> -----------

> Use that freed space to store the first ordered tuples:

> -----------
> 014736.2.58
> -----------

> Commit, and when the last transaction to which the "." tuples above are 
> still visible completes mark them as free with VACUUM or similar.

> -----------
> 014736 2 58
> -----------

Oh, the problem is that you're mi***plaining this.  You can't do it like
that: you can't overwrite the moved-up "." tuples until after they
aren't visible to any other transaction.  So you need two transactions
to do the above.  I'm not sure if you need two "wait for all others" or
just one --- it's not clear to me what's the urgency of clearing out the
moved-down tuples after they're moved down.  (You *would* want to vacuum
every so often, but this is to reclaim index space, not so much heap
space because you'll reuse that anyway.)

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.

			regards, tom lane

-- 
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 Oct 13 7:14:45 CDT 2008.