설문조사
PostgreSQL/PPAS 관련 듣고 싶은 교육은


Powered by EnterpriseDB
총 게시물 55건, 최근 0 건
   

DBA_SQL#1. 테이블이 sequential scan 또는 index scan 이 많이 발생하는지 살펴보는 쿼리

글쓴이 : power 날짜 : 2014-12-19 (금) 20:22 조회 : 949

SELECT schemaname,relname,seq_scan,idx_scan,cast(idx_scan AS numeric) / (idx_scan + seq_scan) AS idx_scan_pct 
FROM pg_stat_user_tables 
WHERE (idx_scan + seq_scan)>0 ORDER BY idx_scan_pct;

SELECT relname,seq_tup_read,idx_tup_fetch,cast(idx_tup_fetch AS  numeric) / (idx_tup_fetch + seq_tup_read) AS idx_tup_pct 
FROM pg_stat_user_tables WHERE (idx_tup_fetch + seq_tup_read)>0 ORDER BY idx_tup_pct

   

postgresdba.com