Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > sql_optimize

sql_optimize

The sql_optimize() function is used to optimise an SQL table. This function is called by the optimiser_base_une_table() function which is periodically called by the cron mechanism. Please refer to the OPTIMIZE TABLE or VACUUM commands for the appropriate SQL database manager to understand the details of what is being executed by these commands.

The function accepts 3 parameters:

  1. $table is the name of the table to be optimised,
  2. $serveur,
  3. $option.

Usage:

  1. sql_optimize('table');

Note: SQLite can not optimise one table at a time, but optimises the entire database in one hit. In this case, if the sql_optimize() function is called multiple times in a row, then the operation will actually only be performed just once for the first call.

  • Author :
  • Published :
  • Updated : 02/06/10
  • Translations : English, français