ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:session:reference:optimize

This is an old revision of the document!


ADOdb_Session::optimize

Supported Databases
  • MySQL
  • Postgres
Syntax
bool ADOdb_Session::optimize(
  optional bool $enableOptimization
  )

Description

If the attached database is either MySQL or Postgres, the static method optimize sets or gets table optimization on the session connection.


When the Garbage Collection routine runs, then the following table maintenance events occur:

MySQL

OPTIMIZE TABLE <session-table>

Postgres

VACUUM <session-table>

These maintenance routines maximize the throughput of the table by reorganizing keys and reclaiming table space

The value must be set before config() is called

Use As A Getter

When used without parameters it returns the currently set value

Usage

include_once 'adodb/adodb.inc.php';
include_once "adodb/session/adodb-session2.php";
 
ADOdb_session::optimize(true);
ADOdb_session::config('mysqli',$host,$user,$pass,$database);
v5/session/reference/optimize.1463870498.txt.gz · Last modified: 2017/04/21 11:38 (external edit)