Postgresql / PPAS/운영
-
[PPAS / Postgresql]해당 Instance 내의 INDEX 확인.Postgresql / PPAS/운영 2014. 11. 18. 17:33
SELECT i.relname AS indname, i.relowner AS indowner, idx.indrelid::regclass, am.amname AS indam, idx.indkey, ARRAY( SELECT pg_get_indexdef(idx.indexrelid, k + 1, TRUE) FROM generate_subscripts(idx.indkey, 1) AS k ORDER BY k ) AS indkey_names, idx.indexprs IS NOT NULL AS indexprs, idx.indpred IS NOT NULL AS indpredFROM pg_index AS idxJOIN pg_class AS iON i.oid = idx.indexrelidJOIN pg_am AS amON i..
-
[PPAS / Postgresql] 테이블 사이즈 확인Postgresql / PPAS/운영 2014. 11. 18. 17:31
- 테이블 사이즈 확인SELECT relname AS "relation", pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"FROM pg_class CLEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) WHERE nspname NOT IN ('pg_catalog', 'information_schema') AND C.relkind 'i'AND nspname !~ '^pg_toast'ORDER BY pg_total_relation_size(C.oid) DESC LIMIT 20;