-
Task
-
Resolution: Done
-
Normal
-
None
There are old records stuck in yupana which yupana's garbage collector is unable to delete, due to this DB storage has got fulled and yupana pods are down.
We want to truncate all the tables in yupana database. As yupana is kind of a stateless application data is not that crucial.
Below are the query we want to run against yupana DB.
select pg_size_pretty(pg_total_relation_size('api_report')) as api_report; select pg_size_pretty(pg_total_relation_size('api_reportslice')) as api_reportslice; select pg_size_pretty(pg_total_relation_size('api_reportarchive')) as api_reportarchive; select pg_size_pretty(pg_total_relation_size('api_reportslicearchive')) as api_reportslicearchive; select count(id) as api_report_count from api_report; select count(id) as api_reportarchive_count from api_reportarchive; select count(id) as api_reportslice_count from api_reportslice; select count(id) as api_reportslicearchive_count from api_reportslicearchive;
We need the output of above query just to get insight of the data. And below are the query which will truncate the tables and help to recover the DB space.
TRUNCATE api_reportslice; TRUNCATE api_reportslicearchive; TRUNCATE api_report CASCADE; TRUNCATE api_reportarchive CASCADE;