Skip to content
Snippets Groups Projects
Commit 6015fad4 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Adds pieces to help debug postgres db growing

parent 833804b3
No related branches found
No related tags found
No related merge requests found
......@@ -50,3 +50,39 @@ By default spilo postgres is configured with:
If logs are eating space, you can change it to off in the crd.
### List postgres table orederd by size
```
SELECT
table_name,
pg_size_pretty( pg_total_relation_size(quote_ident(table_name))),
pg_total_relation_size(quote_ident(table_name))
FROM
information_schema.tables
WHERE
table_schema = 'public'
ORDER BY
pg_total_relation_size(quote_ident(table_name)) DESC
;
```
### Show index size of table
```
SELECT
pg_size_pretty (pg_indexes_size('table_name'));
```
### Show indexes of table
```
select *
from pg_indexes
where tablename = 'table_name';
```
### ReIndex all the indexes
```
REINDEX INDEX indexname
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment