# High Performance PostgreSQL for Rails: How to show autovacuum\_vacuum\_scale\_factor per table (p. 171)

**URL:** <https://forum.devtalk.com/t/high-performance-postgresql-for-rails-how-to-show-autovacuum-vacuum-scale-factor-per-table-p-171/146791>\
**Category:** PragProg Customers\
**Tags:** book-high-performance-postgresql-for-rails, question\
**Created:** [9 March 2024 18:39 UTC](https://forum.devtalk.com/t/high-performance-postgresql-for-rails-how-to-show-autovacuum-vacuum-scale-factor-per-table-p-171/146791 "2024-03-09T18:39:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![andatki](https://forum.devtalk.com/user_avatar/forum.devtalk.com/andatki/32/5332_2.png) [@andatki](https://forum.devtalk.com/u/andatki)\
**Post date:** [12 March 2024 17:58 UTC](https://forum.devtalk.com/t/high-performance-postgresql-for-rails-how-to-show-autovacuum-vacuum-scale-factor-per-table-p-171/146791/2 "2024-03-12T17:58:19Z")

</div>

Hey Daniela! Good question. I’m adding a query (thanks ChatGPT) you can run on your DB to find this information. We can query the `pg_class` system catalog to get it. To test this, I set the AV scale factor using the command you listed and made sure the expected option name and value appeared in the result.

Because this seems generally useful, I’ve added this query to my `pg_scrips` repository on GitHub. There’s also a commented out section showing the result when run on my local Rideshare DB.

[https://github.com/andyatkinson/pg\_scripts/blob/main/per\_table\_options\_reloptions\_all\_regular\_tables.sql](https://github.com/andyatkinson/pg_scripts/blob/main/per_table_options_reloptions_all_regular_tables.sql)

Besides querying this information, another tactic could be adding these changes to your local dev DB, since they’re dumped into the `db/structure.sql`.

Here’s a snippet below where Autovacuum was disabled for a table, showing the line it adds to `db/structure.sql`.

While this AV change wouldn’t likely wouldn’t be necessary locally, documenting a change like this in the `db/structure.sql` could be helpful on a team of people interested in this info.

```sql
“+WITH (autovacuum_enabled='false');”

```

Hope that helps!

---

_[View the full topic](https://forum.devtalk.com/t/high-performance-postgresql-for-rails-how-to-show-autovacuum-vacuum-scale-factor-per-table-p-171/146791)._
