PHPackages                             cytech-services/laravel-postgres-vacuum-analyze - 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. cytech-services/laravel-postgres-vacuum-analyze

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

cytech-services/laravel-postgres-vacuum-analyze
===============================================

A laravel package to vacuum and analyze tables in specific schemas

v1.1.0(1y ago)025[4 PRs](https://github.com/cytech-services/laravel-postgres-vacuum-analyze/pulls)MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Feb 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/cytech-services/laravel-postgres-vacuum-analyze)[ Packagist](https://packagist.org/packages/cytech-services/laravel-postgres-vacuum-analyze)[ Docs](https://github.com/cytech-services/laravel-postgres-vacuum-analyze)[ GitHub Sponsors](https://github.com/cytech-services)[ RSS](/packages/cytech-services-laravel-postgres-vacuum-analyze/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (12)Versions (11)Used By (0)

A laravel package to vacuum and analyze tables in the public shema
==================================================================

[](#a-laravel-package-to-vacuum-and-analyze-tables-in-the-public-shema)

[![Latest Version on Packagist](https://camo.githubusercontent.com/664f6182303632b24baf46a862d3b3259c296d8fc2f92fbd4fd32027804db1be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6379746563682d73657276696365732f6c61726176656c2d706f7374677265732d76616375756d2d616e616c797a652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cytech-services/laravel-postgres-vacuum-analyze)[![GitHub Tests Action Status](https://camo.githubusercontent.com/8ca2262f1d21e73fb0090d471018fd17db98241daa308b9c909e5bb4abbf8b62/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6379746563682d73657276696365732f6c61726176656c2d706f7374677265732d76616375756d2d616e616c797a652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cytech-services/laravel-postgres-vacuum-analyze/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5c755a43d2aceba9a862aded0878c925fa6153be2e98161ce5a44060c3ac4227/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6379746563682d73657276696365732f6c61726176656c2d706f7374677265732d76616375756d2d616e616c797a652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/cytech-services/laravel-postgres-vacuum-analyze/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/a8aa14d48c2f85dc782898c3325417e6cb0e2144ee42d7aa2d66ac6b26efc68d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6379746563682d73657276696365732f6c61726176656c2d706f7374677265732d76616375756d2d616e616c797a652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cytech-services/laravel-postgres-vacuum-analyze)

This package provides a command that will vacuum and analylze tables for specific Laravel database connections for specific schemas. You can then create a scheduled task for this command to regularly optimize your database!

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require cytech-services/laravel-postgres-vacuum-analyze
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-postgres-vacuum-analyze-config"
```

This is the contents of the published config file:

```
return [

    /**
     * The connections to use for the vacuum analyze command.
     */
    'connections' => [
        /**
         * The connection name.
         * By default, the connection name is the default postgres connection.
         */
        'pgsql' => [
            /**
             * The schema name.
             * By default, the schema name is the public schema.
             */
            'public' => [
                /**
                 * A array list of tables to include in the vacuum analyze command.
                 * If no tables are specified, all tables will be included.
                 */
                'include' => [
                    //
                ],

                /**
                 * A array list of tables to exclude in the vacuum analyze command.
                 */
                'exclude' => [
                    //
                ],
            ],
        ],
    ],

    // Enable or disable the logging of errors.
    'log_errors' => true,

    // Enable or disable verbose logging.
    'log_verbose' => true,
];
```

Usage
-----

[](#usage)

```
php artisan db:vacuum-analyze
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Christopher Graham](https://github.com/cytech-services)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance72

Regular maintenance activity

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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 ~12 days

Total

6

Last Release

391d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0018e108ff48fea1ef46a698763e1e558ab8ec73de741a84e620a467bb0df7f3?d=identicon)[cytechservices](/maintainers/cytechservices)

---

Top Contributors

[![sc-chgraham](https://avatars.githubusercontent.com/u/97906213?v=4)](https://github.com/sc-chgraham "sc-chgraham (20 commits)")[![cytech-services](https://avatars.githubusercontent.com/u/69510509?v=4)](https://github.com/cytech-services "cytech-services (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelpostgresqlpostgresCytech Services LLClaravel-postgres-vacuum-analyzeChristopher Grahamdatabase vacuumdatabase analyze

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cytech-services-laravel-postgres-vacuum-analyze/health.svg)

```
[![Health](https://phpackages.com/badges/cytech-services-laravel-postgres-vacuum-analyze/health.svg)](https://phpackages.com/packages/cytech-services-laravel-postgres-vacuum-analyze)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-sql-commenter

Add comments to SQL queries made by Laravel

1931.4M1](/packages/spatie-laravel-sql-commenter)[spatie/laravel-deleted-models

Automatically copy deleted records to a separate table

409109.8k4](/packages/spatie-laravel-deleted-models)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

203330.1k2](/packages/wnx-laravel-backup-restore)

PHPackages © 2026

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