Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
procedures
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
libre.sh
kubernetes
procedures
Commits
6015fad4
Commit
6015fad4
authored
2 years ago
by
Pierre Ozoux
Browse files
Options
Downloads
Patches
Plain Diff
Adds pieces to help debug postgres db growing
parent
833804b3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
operators/postgres.md
+36
-0
36 additions, 0 deletions
operators/postgres.md
with
36 additions
and
0 deletions
operators/postgres.md
+
36
−
0
View file @
6015fad4
...
...
@@ -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
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment