2019年11月7日 星期四

PostgreSQL 維護


SELECT pg_size_pretty( pg_database_size('dspace_getcdb_tst') );
pg_size_pretty: "2112 MB"


SELECT pg_size_pretty( pg_total_relation_size('bitstream') );
pg_size_pretty: "57 MB"



vacuum verbose analyze metadatavalue


Vacuum 前
metadatavalue
Table Size 320 MB
Toast Table Size 9480 kB
Indexes Size 376 MB

執行 Vacuum 指令
vacuum full verbose metadatavalue
INFO:  vacuuming "public.metadatavalue"
INFO:  "metadatavalue": found 1256 removable, 11800 nonremovable row versions in 40949 pages
DETAIL:  0 dead row versions cannot be removed yet.
CPU 0.35s/0.15u sec elapsed 0.50 sec.
Query returned successfully with no result in 693 ms.

Vacuum 後
metadatavalue
Table Size 2768 kB
Toast Table Size 7840 kB
Indexes Size 1120 kB


沒有留言:

張貼留言

網誌存檔