List:General Discussion« Previous MessageNext Message »
From:Ian P. Christian Date:March 30 2007 2:48pm
Subject:Re: a 'safe' way to move data?
View as plain text  
Dan Nelson wrote:
 > To be completely safe, you would want to use innodb tables, then select
 > only the primary key of the 50,000 records you're interested in, using
 > the "FOR UPDATE" keyword (to keep others from modifying those records
 > while you're doing the move).  Then "INSERT INTO newtable SELECT * FROM
 > oldtable WHERE primarykey in ( your 50,000 keys )", then "DELETE FROM
 > oldtable WHERE primarykey in ( your 50,000 keys )", then COMMIT, which
 > will cause your insertions and deletions to be truly atomic.

Ah of course - a far better idea.

Thanks :)

-- 
Ian P. Christian ~ http://pookey.co.uk
Thread
a 'safe' way to move data?Ian P. Christian30 Mar
  • Re: a 'safe' way to move data?Ananda Kumar30 Mar
  • Re: a 'safe' way to move data?Brent Baisley30 Mar
    • Re: a 'safe' way to move data?Ian P. Christian30 Mar
      • Re: a 'safe' way to move data?Dan Nelson30 Mar
        • Re: a 'safe' way to move data?Ian P. Christian30 Mar