SunshinePHP Developer Conference 2015

dba_optimize

(PHP 4, PHP 5)

dba_optimizeOptimise une base DBA

Description

bool dba_optimize ( resource $handle )

dba_optimize() optimise la base de données identifiée par handle.

Liste de paramètres

handle

Le gestionnaire de base de données, retourné par la fonction dba_open() ou la fonction dba_popen().

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.

Voir aussi

  • dba_sync() - Synchronise une base de données DBA

add a note add a note

User Contributed Notes 2 notes

up
0
doppelbauer at gmail dot com
8 years ago
The difference between "dba_optimize" and "dba_sync":

Use "dba_optimize" to optimize a database, which usually consists of eliminating gaps between records created by deletes.

The "dba_sync" function will synchronize the view of the database in memory and its image on the disk. As you insert records, they may be cached in memory by the underlying engine. Other processes reading from the database will not see these new records until synchronization.
up
0
samuele at removethisnorsam dot org
11 years ago
Note that the internal structure of each DB that needs to access etherogeneous data in a *fast* way it is not necessarily space-optimized. So, if you add-remove-substitute keys with data having different content length, the db continues to grow, wasting space. So, it is necessary, sometimes, to re-pack the db in order to remove unused data from the db itself. But it is important to remind that, even if the file grows, the data remain optimized and - obviously - the access continues to be fast. Further information are available at dba_replace() user-contributed notes.
To Top