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


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

DBA_SQL#3. 테이블별 INSERT/ UPDATE/ DELETE 발생 빈도수 살펴보는 쿼리

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

SELECT relname,cast(n_tup_ins AS numeric) / (n_tup_ins + n_tup_upd + n_tup_del) AS ins_pct,cast(n_tup_upd AS numeric) / (n_tup_ins + n_tup_upd + n_tup_del) AS upd_pct, 
cast(n_tup_del AS numeric) / (n_tup_ins + n_tup_upd + n_tup_del) AS del_pct FROM pg_stat_user_tables WHERE (n_tup_ins + n_tup_upd + n_tup_del) >0 ORDER BY relname;


   

postgresdba.com