Aleksandrs Posted February 25, 2005 Report Share Posted February 25, 2005 Kā no konkrētas datubāzes izskaitļot, katras tabulas nosakumu un to pēc tam optimizēt? Link to comment Share on other sites More sharing options...
Aleksandrs Posted February 25, 2005 Author Report Share Posted February 25, 2005 (edited) Padomāju, sanāca šāds kods: <? ini_set('max_execution_time', 0); $c_db = 'db'; $mysql = @mysql_connect('localhost', 'user', 'password'); if(!$mysql){ exit('Connect error!'); } $mysql = @mysql_select_db($c_db); if(!$mysql){ exit('Database error!'); } $query = 'SHOW TABLE STATUS FROM `'.$c_db.'`'; $results = mysql_query($query); while($row = @mysql_fetch_assoc($results)){ if($row['Data_free']>0){ mysql_query('OPTIMIZE TABLE `'.$row['Name'].'`'); } } ?> Es tikai nevaru saprast, vai pēc optimize ir jalieto flush tables? Edited February 25, 2005 by Aleksandrs Link to comment Share on other sites More sharing options...
рпр Posted February 25, 2005 Report Share Posted February 25, 2005 nav jālieto flush pēc optimize. Link to comment Share on other sites More sharing options...
Recommended Posts