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


총 게시물 162건, 최근 0 건
   

DBA_SQL#4. 테이블과 인덱스 I/O 살펴보는 쿼리

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

SELECT relname,cast(heap_blks_hit as numeric) / (heap_blks_hit + heap_blks_read) AS hit_pct,heap_blks_hit,heap_blks_read FROM pg_statio_user_tables
WHERE (heap_blks_hit + heap_blks_read)>0 ORDER BY hit_pct;


SELECT indexrelname,cast(idx_blks_hit as numeric) / (idx_blks_hit + idx_blks_read) AS hit_pct,idx_blks_hit,idx_blks_read FROM pg_statio_user_indexes WHERE (idx_blks_hit + idx_blks_read)>0 ORDER BY hit_pct;


진깨비 2017-12-21 (목) 17:04
우선 좋은 쿼리문 공유 감사합니다!

해당 데이터는 기준은 어떤 값인가요?
DB생성 후 부터 쿼리를 날린 순간까지의 값인가요?

사내 테스트 DB에 간격을 두고 Execute해보았는데 값이 변화가 없는것 같아서 궁금합니다!
댓글주소
주킹 2017-12-22 (금) 08:43
통계정보가 안돌면 간격을 두고해도 소용이 없겠죠 ㅎㅎ
댓글주소
     
     
진깨비 2017-12-26 (화) 23:19
사내 QA서버여서 테스터분들이 계속 열심히 데이터를 요청하고는 있습니다
총 통계량에 비해 너무 미세해서 그럴까요...
댓글주소
   

postgresdba.com