VACUUM Simulator lets you tweak autovacuum settings to learn the relationship between Postgres configuration settings and autovacuum patterns. It also helps you find better autovacuum settings for the table.
Currently deployed on Netlify with a default deploy option.
Sample table stats json files are located in /src/sampledata
. You can add a
new sample data over there. The sample data shape is not the same as the one
that you can collect using /src/sampledata/collector.sql
, but it is the same
as what you can obtain via pganalyze GraphQL.
Notably, deletes/inserts/updates/hotUpdates
are different as they are using
the diff data (how much it increased from the previous data collection) with the
pganalyze data, while collector.sql
will be the cumulative value since the
last stats reset.
Once a sample json file is placed, update the following parts so that it can show up as a new sample table option in the UI:
/src/components/VacuumSimulator/index.tsx
SampleTableName
getSampleTableStats
VACUUM Simulator is a simple React application, so you can use all usual tricks of React app.
npm install
to install all dependenciesnpm start
to run the app in the development modenpm run build
to build the app for production to thebuild
folder
VACUUM Simulator is originally developed by pganalyze, as a part of the VACUUM Advisor feature. You can use the VACUUM Simulator in pganalyze too, using your actual database usage.
Big thanks to pganalyze for letting this project go open source and for providing reference data from pganalyze's own database as examples.