Database Reference
In-Depth Information
Determining the bloat factor
You are able to determine whether your database needs a VACUUM by performing the table
and index bloat query, which tells you in case there are any dead rows. Heroku offers a
plugin called pg-extras to Heroku Toolbelt that allows this query to be performed.
First, install the plugin:
$ heroku plugins:install git://github.com/heroku/
heroku-pg-extras.git
Installing heroku-pg-extras... done
Now you can run the pg:bloat command in order to get statistics about your database:
$ heroku pg:bloat DATABASE_URL --app your-app-name
type | schemaname | object_name | bloat |
waste
------+------------+--------------------------+-------+-------
table | public | invitations | 11.5 | 210
MB
table | public | selected_flight_options | 2.6 | 360
kB
As a result of this command, you have the bloat factor. If this is greater than 10, it indic-
ates that this table may be experiencing degraded performance, and corrective action is re-
commended, especially indicated for tables larger than 100 MB.
Search WWH ::




Custom Search