Category: MySQLDevelopment

Tips

Some ideas about possible optimisations:

[edit] Optimising big deletes

If you want to do a big delete, say one which removes more than 50% of the rows in a table, you'll probably find that the table doesn't shrink (much) when you do it. Moreover, it might take quite a long time, especially if your table has many indexes.

A possible alternative would be to create a new table with the same schema, and transfer only the rows to KEEP in. Then rename the table with ALTER TABLE or RENAME TABLE.

This kind of thing can also be done with OPTIMIZE TABLE, but that could also be very slow.


[edit] ANALYZE vs ALTER TABLE

It appears that "ALTER TABLE Engine=MyISAM" does as much analysis as ANALYZE table, but unlike ANALYZE table, it doesn't block reads on the table while it's doing it. This may be helpful, especially if you need to do other alterations at the same time.

Retrieved from "http://forge.mysql.com/wiki/Tips"

This page has been accessed 956 times. This page was last modified 12:38, 19 September 2007.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...