John P. Looney wrote:
> Today, someone asked me to have a look at some slow PHP. It turns out
> they were doing a select on a table. Simple table, with nothing in it.
>> But, it was 60MB in size. It took two seconds for a "select *" to
> complete. Bad. So, I ran myiasmchk and myasmpack on it, and it reduced to
> 1k in size, and selects worked *instantly*.
>> This makes me happy.
>> Is there any problem with writing a script to go through every database
> on the system, and run those two commands automatically every weekend, on
> every table ?
'Optimise Table' (in phpMyAdmin or equiv) will clean and re-order the
indexes, which improves speed quite a bit for highly fragged tables.
'myisampack', on the other hand, creates a highly-optimised compressed
structure using a multiple-pass algorithm. This makes it very fast, but
read-only.
Vin
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!