Download the PHP package simbiat/db-maintainer without Composer
On this page you can find all versions of the php package simbiat/db-maintainer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package db-maintainer
Database Tables Maintainer
This library is an evolution of Optimize Tables developed to suggest and optionally run various maintenance tasks on tables in MySQL and MariaDB (potentially, other forks, but not tested). While MS SQL has its Maintenance Plan Wizard, there is nothing like that for MySQL.
Benefits
One may think that simply getting a list of tables and running OPTIMIZE against them is enough, but in reality, it's not that simple:
- Not all engines support all commands, including OPTIMIZE.
- There are some special parameters that may improve OPTIMIZE results in the case of FULLTEXT indexes.
- It's useful to periodically run
CHECKto avoid potential corruption of tables, but running them too frequently may affect service availability. - ANALYZE is quite a useful command as well, allowing to update MySQL statistics that may improve some of the SELECT queries, which may not be needed in case of
OPTIMIZE. - MariaDB 10.4+ and MySQL 8.0+ also support histograms that may improve SELECT in cases when a column does not have indexes for some reason.
- No matter how useful these commands are, there are cases when you do not need to run them, especially on large tables, since they may take quite some time to complete. The simplest case: there have been no or very few changes since the last time the OPTIMIZE was run.
- FULLTEXT indexes may also require rebuild in the case of certain server settings changing.
This library aims to cover all these points in as smart a manner as was possible at the moment of writing. For details, refer to this readme or comments in the code.
Pre-requisites
- DB Query
- DB Manager
- PHP 8.4+ with MBString enabled
- MySQL or MariaDB with read access to
information_schema(and optionallymysql) schema and read-write access to schema fromPDOobject
Installation
- Download (manually or through composer).
- Establish DB connection using DB Pool library or passing a
PDOobject toInstaller's constructor. - Install:
This will create a few tables in the database with a maintainer__ prefix by default. If a different prefix is desired, check customization documentation. Further documentation will use maintainer__ prefix, when referencing respective tables.
Usage
- Analysis and automation
- Manual operations
- Customization
All versions of db-maintainer with dependencies
simbiat/db-query Version ^1.0.2
simbiat/db-manager Version ^1.0.1
simbiat/db-installer Version ^1
simbiat/stringhelpers Version ^2.0
simbiat/arrayhelpers Version ^4.1
ext-mbstring Version *