ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:session:reference:optimize

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.txt · Last modified: 2018/07/01 22:03 by peterdd