On Wednesday 21 March 2007 16:31, Paul J. Boyes wrote:
> Hello,
>
> I have a fairly sizeable aggregate table that is built from a large
> amount of data that is going to receive a large volume of reads. I am
> looking at possibly using the rename to swap the table out regularly
> with an updated one. Is this a viable solution for a table that
> experiences a large number of reads? Will it work? What are the drawbacks?
>
> Having never done this with MySQL, I am hoping to get some advice from
> others who may have attempted this, are in the know, etc....Any info you
> can provide would be greatly appreciated.

In my experience it is safe and fast to do this sort of thing:

RENAME TABLE live_table TO old_table, new_table TO live_table;

As far as I know doing the 2 renames in one command (as above)
is the only way to do them atomically in MySQL.

Hope that helps,

  -Chris

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to