Skip to content

Instantly share code, notes, and snippets.

View martinciu's full-sized avatar
😋
Wasup?

Marcin Ciunelis martinciu

😋
Wasup?
View GitHub Profile
@martinciu
martinciu / Postgres Index Usage.sql
Created July 31, 2012 13:56 — forked from next2you/Postgres Index Usage.sql
Postgres: Determine table/index size
SELECT idx.relname as table,
idx.indexrelname as index,
pg_size_pretty(pg_relation_size( idx.indexrelname::text )) as bytes,
cls.relpages as pages,
cls.reltuples as tuples,
idx.idx_scan as scanned,
idx.idx_tup_read as read,
idx.idx_tup_fetch as fetched
FROM pg_stat_user_indexes idx,
pg_class cls ,