
May 23rd, 2000, 10:07 AM
|
|
Contributing User
|
|
Join Date: May 2000
Posts: 109
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
How do you call the command -
from a PHP-Script or from the command line?
At the command line it must work with the command "optimize table tablename;" if you have the privileges to do this!
The following information I have copied from the Manual of MySql:
>OPTIMIZE TABLE tbl_name
>
>OPTIMZE TABLE should be used if >you have deleted a large part of >a table or if you have made many >changes to a table with >variable-length rows
>(tables that have VARCHAR, BLOB >or TEXT columns). Deleted >records are maintained in a >linked list and subsequent >INSERT operations reuse old
>record positions. You can use >OPTIMIZE TABLE to reclaim the >unused space.
>
>OPTIMIZE TABLE works by making a >temporary copy of the original >table; The old table is copied >to the new table (without the >unused rows),
>then the original table is >deleted and the new one is >renamed. While OPTIMIZE TABLE is >executing, the original table is >readable by other clients.
>Updates and writes to the table >are stalled until the new table >is ready. This is done in such a >way that all updates are >automatically redirected to
>the new table without any failed >updates.
|