系统表数据清理sql
select concat( 'vacuum full "', schemaname, '"."', relname, E'";\n', 'analyze "', schemaname, '"."', relname, E'";\n' ) ,schemaname,relname, pg_size_pretty(pg_relation_size(relid)),* from pg_stat_user_tables order by pg_relation_size(relid) desc nulls last limit 100;
其他表数据清理sql
select concat( 'vacuum full "', schemaname, '"."', relname, E'";\n', 'analyze "', schemaname, '"."', relname, E'";\n' ) ,schemaname,relname, pg_size_pretty(pg_relation_size(relid)),* from pg_stat_user_tables order by pg_relation_size(relid) desc nulls last limit 100