{"id":24782574,"url":"https://github.com/levkk/pg-vacuum","last_synced_at":"2025-10-12T05:31:27.881Z","repository":{"id":57452216,"uuid":"255115458","full_name":"levkk/pg-vacuum","owner":"levkk","description":"Managing PostgreSQL Vacuum","archived":false,"fork":false,"pushed_at":"2020-05-25T20:45:39.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T10:14:26.473Z","etag":null,"topics":["autovacuum","postgresql","vacuum"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/levkk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-12T15:43:18.000Z","updated_at":"2022-11-13T13:29:40.000Z","dependencies_parsed_at":"2022-09-02T06:43:53.057Z","dependency_job_id":null,"html_url":"https://github.com/levkk/pg-vacuum","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkk%2Fpg-vacuum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkk%2Fpg-vacuum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkk%2Fpg-vacuum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levkk%2Fpg-vacuum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levkk","download_url":"https://codeload.github.com/levkk/pg-vacuum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236169067,"owners_count":19106105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autovacuum","postgresql","vacuum"],"created_at":"2025-01-29T11:18:06.213Z","updated_at":"2025-10-12T05:31:27.584Z","avatar_url":"https://github.com/levkk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pg-vacuum\nManaging PostgreSQL vacuums/autovacuums. This little tool will hopefully make managing the craziness that Postgres autovacuum is a little easier.\n\n## Features\n\n### Show current vacuums/autovacuums\nIt will show you how long the vacuums are running for and how much is left to do.\n\n```bash\n$ pgvacuum --database=postgres://localhost/db\n\n+-------+--------------------------------------+----------------------------------+----------------+\n|  PID  |                Query                 |             Started              |    Duration    |\n+-------+--------------------------------------+----------------------------------+----------------+\n| 13368 |  autovacuum: VACUUM public.drivers   | 2020-04-16 14:19:17.289047+00:00 | 0:53:24.403651 |\n| 80617 | autovacuum: VACUUM public.old_carts  | 2020-04-16 14:16:17.484278+00:00 | 0:56:24.208420 |\n| 92409 | autovacuum: VACUUM public.table_one_ | 2020-04-16 13:21:37.663504+00:00 | 1:51:04.029194 |\n| 79790 |  autovacuum: VACUUM public.devices   | 2020-04-16 14:44:18.791010+00:00 | 0:28:22.901688 |\n| 97037 |   autovacuum: VACUUM public.users    | 2020-04-16 12:21:10.163915+00:00 | 2:51:31.528783 |\n+-------+--------------------------------------+----------------------------------+----------------+\n```\n\n\n### Show progress of vacuums/autovacuums\n\n```bash\n$ pgvacuum --database=postgres://localhost/db --progress\n\n+-------+------------+-------------------+----------+----------------------------------+----------------+\n|  PID  |   Table    |       Phase       | Progress |             Started              |    Duration    |\n+-------+------------+-------------------+----------+----------------------------------+----------------+\n| 92409 | table_one_ | vacuuming indexes |   100    | 2020-04-16 13:21:37.663504+00:00 | 1:54:48.656212 |\n| 97037 |   users    | vacuuming indexes |   100    | 2020-04-16 12:21:10.163915+00:00 | 2:55:16.155801 |\n| 79790 |  devices   | vacuuming indexes |   100    | 2020-04-16 14:44:18.791010+00:00 | 0:32:07.528706 |\n| 13368 |  table_t   | vacuuming indexes |   100    | 2020-04-16 14:19:17.289047+00:00 | 0:57:09.030669 |\n| 80617 | old_carts  | vacuuming indexes |   100    | 2020-04-16 14:16:17.484278+00:00 | 1:00:08.835438 |\n+-------+------------+-------------------+----------+----------------------------------+----------------+\n```\n\n### Enable/disable autovacuum on a table\n\n```bash\n# Disable the autovacuum on this table\n$ pgvacuum --database=postgres://localhost/db --table=my_table --disable\n\n# Enable the autovacuum on this table\n$ pgvacuum --database=postgres://localhost/db --table=my_table --enable\n```\n\n### Show table settings\n\nShow what current settings are set on the table.\n\n```bash\n$ pgvacuum --database=postgres://localhost/db --table=my_table\n\n+--------------------------------+-----------+\n|            Setting             |   Value   |\n+--------------------------------+-----------+\n|   autovacuum_freeze_max_age    | 500000000 |\n| autovacuum_vacuum_scale_factor |    0.02   |\n|       autovacuum_enabled       |   false   |\n+--------------------------------+-----------+\n```\n\n### Show autovacuum settings\n\nShow current database autovacuum settings.\n\n```bash\npgvacuum --database=postgres://localhost/src --settings\n\n+---------------------------------+-----------+\n|             Setting             |   Value   |\n+---------------------------------+-----------+\n|   autovacuum_vacuum_cost_delay  |    2ms    |\n|   autovacuum_vacuum_cost_limit  |    200    |\n|        autovacuum_naptime       |    1min   |\n|  autovacuum_vacuum_scale_factor |    0.2    |\n| autovacuum_analyze_scale_factor |    0.1    |\n|    autovacuum_freeze_max_age    | 200000000 |\n|           track_counts          |     on    |\n+---------------------------------+-----------+\n```\n\n\n### Terminate the autovacuums\n\nOk, you've had enough of it.\n\n```bash\n$ pgvacuum --database=postgres://localhost/db --kill=1234\n```\n\nwhere `1234` is the PID of the vacuum/autovacuum process.\n\n\n### Arguments\n1. `--database` (required), DSN or `postgres://` URL for the database,\n2. `--progress`, show the progress of running vacuums,\n3. `--table`, show settings for this table,\n4. `--enable/disable`, to be used in conjunction with `--table` to enable/disable autovacuum on it,\n5. `--kill`, kill the autovacuum/vacuum with this PID,\n6. `--settings`, show settings for the database.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevkk%2Fpg-vacuum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevkk%2Fpg-vacuum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevkk%2Fpg-vacuum/lists"}