dm_db_optimize Function

public function dm_db_optimize(db) result(rc)

Attempts to optimise the database. All schemas are optimised.

To achieve the best long-term query performance without the need to do a detailed engineering analysis of the application schema and SQL, it is recommended that applications run PRAGMA optimize (with no arguments) just before closing each database connection. Long-running applications might also benefit from setting a timer to run PRAGMA optimize every few hours.

The function returns the following error codes:

  • E_DB_PREPARE if statement preparation failed.
  • E_DB_STEP if step execution failed or no write permission.

Arguments

Type IntentOptional Attributes Name
type(db_type), intent(inout) :: db

Database type.

Return Value integer


Calls

proc~~dm_db_optimize~~CallsGraph proc~dm_db_optimize dm_db_optimize sqlite3_finalize sqlite3_finalize proc~dm_db_optimize->sqlite3_finalize sqlite3_prepare_v2 sqlite3_prepare_v2 proc~dm_db_optimize->sqlite3_prepare_v2 sqlite3_step sqlite3_step proc~dm_db_optimize->sqlite3_step

Called by

proc~~dm_db_optimize~~CalledByGraph proc~dm_db_optimize dm_db_optimize proc~dm_db_close dm_db_close proc~dm_db_close->proc~dm_db_optimize proc~dm_db_backup dm_db_backup proc~dm_db_backup->proc~dm_db_close