0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

pgAdmin4でテーブル毎のディスク使用量を見る方法を紹介します。

方法

クエリツールで以下のSQLを実行するとテーブル毎のディスク使用量を確認することができます。

SELECT
     pg_size_pretty(pg_total_relation_size(relid)) AS total_size,
     pg_size_pretty(pg_relation_size(relid)) AS data_size,
     relname
FROM
     pg_catalog.pg_statio_user_tables
ORDER BY
     pg_total_relation_size(relid) DESC;

スクリーンショット

終わりに

データベースとかで無料枠を使用している時に、どのテーブルが容量圧迫してるかわかるので便利ですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?