Skip to content

Instantly share code, notes, and snippets.

View rodion-m's full-sized avatar
🤩
CodeAliving

Rodion Mostovoi rodion-m

🤩
CodeAliving
View GitHub Profile

Другие интересные штуки тут: https://t.me/notes_of_programmer

Размер таблицы с детализацией

select l.metric
     , l.nr                                            as bytes
     , case when is_size then pg_size_pretty(nr) end   as bytes_pretty
     , case when is_size then nr / nullif(x.ct, 0) end as bytes_per_row
from (select min(tableoid)        as tbl     -- = 'public.tbl'::regclass::oid