Sha256: 9808b19f0eb451ca6215cf68998ca4f754d4d84176dd5e6d168e04201082717c

Contents?: true

Size: 384 Bytes

Versions: 18

Compression:

Stored size: 384 Bytes

Contents

/* Size of the tables (excluding indexes), descending by size */

SELECT c.relname AS name,
  pg_size_pretty(pg_table_size(c.oid)) AS size,
  n.nspname as schema
FROM pg_class c
LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)
WHERE n.nspname NOT IN ('pg_catalog', 'information_schema')
AND n.nspname !~ '^pg_toast'
AND c.relkind IN ('r', 'm')
ORDER BY pg_table_size(c.oid) DESC;

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ruby-pg-extras-5.6.7 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.6.6 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.6.5 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.6.4 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.6.3 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.6.2 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.6.1 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.6.0 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.5.1 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.5.0 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.4.5 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.4.4 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.4.3 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.4.2 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.4.1 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.4.0 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.3.1 lib/ruby_pg_extras/queries/table_size.sql
ruby-pg-extras-5.3.0 lib/ruby_pg_extras/queries/table_size.sql