note 17541 added to function.mysql-list-tables
| From: | inerte at NO_SPAM_hotmail dot com | Date: | Thu, 13 Dec 2001 14:19:53 +0000 |
| Subject: | note 17541 added to function.mysql-list-tables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-22580@lists.php.net to get a copy of this message | ||
Sometimes mysql tables can get a little overhead due to heavy usage.<br>Here's a quick
snippet that you can run once in a while to keep things in shape:
$db = 'database_name';
$tables = mysql_list_tables($db);
while (list($table_name) = mysql_fetch_array($tables)) {
$sql = "OPTIMIZE TABLE $table_name";
mysql_query($sql) or exit(mysql_error());
}
--
http://www.php.net/manual/en/function.mysql-list-tables.php
http://master.php.net/manage/user-notes.php?action=edit+17541
http://master.php.net/manage/user-notes.php?action=delete+17541
http://master.php.net/manage/user-notes.php?action=reject+17541