PHPackages                             simbiat/db-maintainer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. simbiat/db-maintainer

ActiveLibrary[Database &amp; ORM](/categories/database)

simbiat/db-maintainer
=====================

Library to maintain database tables using its built-in commands.

1.0.1+20251221(4mo ago)00AGPL-3.0-or-laterPHPPHP ^8.4

Since Jun 5Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Simbiat/db-maintainer)[ Packagist](https://packagist.org/packages/simbiat/db-maintainer)[ Docs](https://github.com/Simbiat/db-maintainer)[ RSS](/packages/simbiat-db-maintainer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Database Tables Maintainer
==========================

[](#database-tables-maintainer)

This library is an evolution of [Optimize Tables](https://github.com/Simbiat/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
========

[](#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 `CHECK` to 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
==============

[](#pre-requisites)

- [DB Query](https://github.com/Simbiat/db-query)
- [DB Manager](https://github.com/Simbiat/db-manager)
- PHP 8.4+ with MBString enabled
- MySQL or MariaDB with read access to `information_schema` (and optionally `mysql`) schema and read-write access to schema from `PDO` object

Installation
============

[](#installation)

1. Download (manually or through composer).
2. Establish DB connection using [DB Pool](https://github.com/Simbiat/db-pool) library or passing a `PDO` object to `Installer`'s constructor.
3. Install:

```
(new \Simbiat\Database\Maintainer\Installer($dbh))->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](doc/Settings.md). Further documentation will use `maintainer__` prefix, when referencing respective tables.

Usage
=====

[](#usage)

- [Analysis and automation](doc/Analyzer.md)
- [Manual operations](doc/Commander.md)
- [Customization](doc/Settings.md)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance85

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~198 days

Total

2

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa2d3e2e878f1cf76c71b73e6a9234203aa627a7afeada368993830d92ee1dde?d=identicon)[Simbiat](/maintainers/Simbiat)

---

Top Contributors

[![Simbiat](https://avatars.githubusercontent.com/u/6022665?v=4)](https://github.com/Simbiat "Simbiat (5 commits)")

---

Tags

phpcheckmysqlpdotablefulltextanalyzeoptimizerepair

### Embed Badge

![Health badge](/badges/simbiat-db-maintainer/health.svg)

```
[![Health](https://phpackages.com/badges/simbiat-db-maintainer/health.svg)](https://phpackages.com/packages/simbiat-db-maintainer)
```

###  Alternatives

[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[eftec/pdoone

Minimaist procedural PDO wrapper library

1105.9k9](/packages/eftec-pdoone)[popphp/pop-db

Pop Db Component for Pop PHP Framework

1814.6k11](/packages/popphp-pop-db)[riverside/php-orm

PHP ORM micro-library and query builder

111.2k](/packages/riverside-php-orm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
