Maintenance script "optimize­Store.php"

From semantic-mediawiki.org
optimizeStore.php
Allows to optimize the storage backend tables
Further Information
Provided by: Semantic MediaWiki
Added: 7.1.0
Removed: still in use
Location (path): ./extensions/SemanticMediaWiki/maintenance/
Table of Contents

The "optimizeStore.php" maintenance script optimizes the storage backend (store) tables independently of the setup process. It was introduced in Semantic MediaWiki 7.1.0Released on 9 July 2026 and compatible with MW 1.43.x - 1.46.x..1

It performs the same table optimization that maintenance script "setupStore.php"Allows to set up the data backend/store carries out by default, so it can be scheduled on its own, for example via cron, without running the full setup routine. Each run records its timestamp as the last_optimization_run information of the setup information file (".smw.json").

When to run

On a regular basis within a period of 90 days maximum to keep the store performing well by having its key distribution analyzed and optimized. This is the standalone equivalent of the optimization that maintenance script "setupStore.php"Allows to set up the data backend/store performs when run without the --skip-optimize parameter. If the optimization was not done within the period of 90 days, the dashboard on Special:Semantic MediaWiki will remind you of this task via a maintenance alert.

Usage

php optimizeStore.php [--backend|--with-maintenance-log]
This only shows the script specific parameters.

Parameters

Maintenance scripts provide generic maintenance parameters, script dependent parameters and depending on the maintenance script script specific parameters which are described on this page if provided.

Script specific parameters
Parameter Description
--backend [backend] Execute the operation for the storage backend of the given name, for example "SMW\SQLStore\SQLStore". Defaults to the configured default store when not provided. The short form -b is also accepted.
--with-maintenance-log Adds a log entry to the "Semantic MediaWiki log" on special page "Log" (&type=smw) recording the run time and memory usage of the maintenance run.

Note

Table optimization is only available for the SQL-based storage backend. Under a non-SQL backend the script reports that optimization is not available and exits without making changes. When running against the ElasticStore backend the underlying SQL tables are optimized; the Elasticsearch index is maintained separately by maintenance script "rebuildElasticIndex.php"Allows to rebuild all the semantic data for the Elasticsearch index.

See also

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:7011

Cookies help us deliver our services. By using our services, you agree to our use of cookies.