Skip to content

Instantly share code, notes, and snippets.

@madebyherzblut
madebyherzblut / query.sql
Last active February 18, 2021 14:31
Postgres Index Stats
SELECT
pt.tablename AS TableName,
t.indexname AS IndexName,
to_char(pc.reltuples, '999,999,999,999') AS TotalRows,
pg_size_pretty(pg_relation_size(quote_ident(pt.tablename)::text)) AS TableSize,
pg_size_pretty(pg_relation_size(quote_ident(t.indexrelname)::text)) AS IndexSize,
to_char(t.idx_scan, '999,999,999,999') AS TotalNumberOfScan,
to_char(t.idx_tup_read, '999,999,999,999') AS TotalTupleRead,
to_char(t.idx_tup_fetch, '999,999,999,999') AS TotalTupleFetched
FROM
@madebyherzblut
madebyherzblut / GPG-Tower
Created May 14, 2019 13:55 — forked from LeonardoCardoso/GPG-Tower
How to setup Tower to use the GPG Suite
# GPG on Tower