📜  postgresql 检查总存储量 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:11.789000             🧑  作者: Mango

代码示例1
SELECT nspname || '.' || relname AS "relation",
    pg_size_pretty(pg_relation_size(C.oid)) AS "size"
  FROM pg_class C
  LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
  WHERE nspname NOT IN ('pg_catalog', 'information_schema')
  ORDER BY pg_relation_size(C.oid) DESC
  LIMIT 20;