Skip to content

Instantly share code, notes, and snippets.

View jsoyland's full-sized avatar

Jesse Soyland jsoyland

View GitHub Profile
@jsoyland
jsoyland / show_table_size.sql
Created October 11, 2022 15:57
Table Size Query
WITH RECURSIVE pg_inherit(inhrelid, inhparent) AS
(select inhrelid, inhparent
FROM pg_inherits
UNION
SELECT child.inhrelid, parent.inhparent
FROM pg_inherit child, pg_inherits parent
WHERE child.inhparent = parent.inhrelid),
pg_inherit_short AS (SELECT * FROM pg_inherit WHERE inhparent NOT IN (SELECT inhrelid FROM pg_inherit))
SELECT table_schema
, TABLE_NAME

Keybase proof

I hereby claim:

  • I am jsoyland on github.
  • I am jsoyland (https://keybase.io/jsoyland) on keybase.
  • I have a public key ASBeWt3jVhafoiDGFuPxy_9DFezBhGhCSjlRUdP2FtstEQo

To claim this, I am signing this object: