====== ADOdb_Session::optimize======
~~NOTOC~~
== 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
==== Postgres====
VACUUM
These maintenance routines maximize the throughput of the table by reorganizing keys and reclaiming table space
The value must be set **//before//** [[v5:session:reference:config|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);