Postgres
Table of Contents
1. Optimize Storage Usage
https://hakibenita.com/postgresql-unused-index-size
- Remove unused index
- Clear bloat in index (i.e. updated rows that are stored as: original marked as deleted and new row inserted)
- pgrepack to repack index
- using partial index if you have index on a column whose some of the value you never query e.g. if a column is nullable and there are alot of nulls but you don't query with `WHERE colmn IS NULL` then create a partial index for non null values only for that column
2. Backup / Restore
pgdump superapp > backup.dump pgrestore superapp < backup.dump
pgdump -U username -Fc databasename > dumpfilename