This release is a pre-release and may not be stable for production use.
pg-vacuum
Managing PostgreSQL vacuums/autovacuums. This little tool will hopefully make managing the craziness that Postgres autovacuum is a little easier.
Features
Show current vacuums/autovacuums
It will show you how long the vacuums are running for and how much is left to do.
$ pgvacuum --database=postgres://localhost/db
+-------+--------------------------------------+----------------------------------+----------------+
| PID | Query | Started | Duration |
+-------+--------------------------------------+----------------------------------+----------------+
| 13368 | autovacuum: VACUUM public.drivers | 2020-04-16 14:19:17.289047+00:00 | 0:53:24.403651 |
| 80617 | autovacuum: VACUUM public.old_carts | 2020-04-16 14:16:17.484278+00:00 | 0:56:24.208420 |
| 92409 | autovacuum: VACUUM public.table_one_ | 2020-04-16 13:21:37.663504+00:00 | 1:51:04.029194 |
| 79790 | autovacuum: VACUUM public.devices | 2020-04-16 14:44:18.791010+00:00 | 0:28:22.901688 |
| 97037 | autovacuum: VACUUM public.users | 2020-04-16 12:21:10.163915+00:00 | 2:51:31.528783 |
+-------+--------------------------------------+----------------------------------+----------------+
Show progress of vacuums/autovacuums
$ pgvacuum --database=postgres://localhost/db --progress
+-------+------------+-------------------+----------+----------------------------------+----------------+
| PID | Table | Phase | Progress | Started | Duration |
+-------+------------+-------------------+----------+----------------------------------+----------------+
| 92409 | table_one_ | vacuuming indexes | 100 | 2020-04-16 13:21:37.663504+00:00 | 1:54:48.656212 |
| 97037 | users | vacuuming indexes | 100 | 2020-04-16 12:21:10.163915+00:00 | 2:55:16.155801 |
| 79790 | devices | vacuuming indexes | 100 | 2020-04-16 14:44:18.791010+00:00 | 0:32:07.528706 |
| 13368 | table_t | vacuuming indexes | 100 | 2020-04-16 14:19:17.289047+00:00 | 0:57:09.030669 |
| 80617 | old_carts | vacuuming indexes | 100 | 2020-04-16 14:16:17.484278+00:00 | 1:00:08.835438 |
+-------+------------+-------------------+----------+----------------------------------+----------------+
Enable/disable autovacuum on a table
# Disable the autovacuum on this table
$ pgvacuum --database=postgres://localhost/db --table=my_table --disable
# Enable the autovacuum on this table
$ pgvacuum --database=postgres://localhost/db --table=my_table --enable
Show table settings
Show what current settings are set on the table.
$ pgvacuum --database=postgres://localhost/db --table=my_table
+--------------------------------+-----------+
| Setting | Value |
+--------------------------------+-----------+
| autovacuum_freeze_max_age | 500000000 |
| autovacuum_vacuum_scale_factor | 0.02 |
| autovacuum_enabled | false |
+--------------------------------+-----------+
Show autovacuum settings
Show current database autovacuum settings.
pgvacuum --database=postgres://localhost/src --settings
+---------------------------------+-----------+
| Setting | Value |
+---------------------------------+-----------+
| autovacuum_vacuum_cost_delay | 2ms |
| autovacuum_vacuum_cost_limit | 200 |
| autovacuum_naptime | 1min |
| autovacuum_vacuum_scale_factor | 0.2 |
| autovacuum_analyze_scale_factor | 0.1 |
| autovacuum_freeze_max_age | 200000000 |
| track_counts | on |
+---------------------------------+-----------+
Terminate the autovacuums
Ok, you've had enough of it.
$ pgvacuum --database=postgres://localhost/db --kill=1234
where 1234 is the PID of the vacuum/autovacuum process.
Arguments
--database(required), DSN orpostgres://URL for the database,--progress, show the progress of running vacuums,--table, show settings for this table,--enable/disable, to be used in conjunction with--tableto enable/disable autovacuum on it,--kill, kill the autovacuum/vacuum with this PID,--settings, show settings for the database.
Metadata
Release files for pg-vacuum 0.1a10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pg-vacuum-0.1a10.tar.gz | 5.2 kB | Without provenance | Details for pg-vacuum-0.1a10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pg_vacuum-0.1a10-py3-none-any.whl | Python 3 | none | any | Details for pg_vacuum-0.1a10-py3-none-any.whl |
Total release size: 11.8 kB
Release files / pg-vacuum-0.1a10.tar.gz
| Download URL | pg-vacuum-0.1a10.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e6bcbd24af588d70658e52caa95f1efbafab4eee3aba7c1a3bb8d75290ab033
|
|
BLAKE2b-256 checksum How to use checksums |
acb3d306e39b3ccf6b0bb737035f2414a705b663f1b776c59a9cbee81e9e92f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5
|
Release files / pg_vacuum-0.1a10-py3-none-any.whl
| Download URL | pg_vacuum-0.1a10-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b708f1d030f960724280c2e4b72a73a92856e2044151e325f0336e186a7f59e7
|
|
BLAKE2b-256 checksum How to use checksums |
65b4fe62fa8c9b3dce76cbced9689bfd5308b5382951f5d8214165ea12016898
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5
|
Security for pg-vacuum 0.1a10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.