Re: Optimize table locks the whole database
Hi.
Yes. That's basically the same (but exchange the table names in the RENAME statement).
However there is a moment where y does not exist. And during the INSERT SELECT you will not be able to insert into y. Even if you could, the newly inserted rows would not be copied to x.
If you are regularily dropping parts of your data and adding new ones, you might be better off with a MERGE table. Adding a new sub-table and droping another one can be done in one go and it is a very quick operation. No data movement is required.
Regards
Ingo
Ingo Strüwing, Senior Software Developer - Storage Engines
MySQL AB, www.mysql.com
Subject
Views
Written By
Posted
10048
December 31, 2006 12:46AM
3564
January 02, 2007 12:34PM
3379
January 04, 2007 04:52AM
3337
January 08, 2007 02:10PM
Re: Optimize table locks the whole database
2939
January 17, 2007 11:07AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.