Sha256: aae92f2cefffa06bd3a3cd6aba0becc3851049f6afca01e8161dce03bc5e7cbf

Contents?: true

Size: 351 Bytes

Versions: 14

Compression:

Stored size: 351 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
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='r'
ORDER BY pg_table_size(c.oid) DESC;

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
ruby-pg-extras-1.2.0 lib/ruby-pg-extras/queries/table_size.sql
ruby-pg-extras-1.1.0 lib/ruby-pg-extras/queries/table_size.sql
ruby-pg-extras-1.0.0 lib/ruby-pg-extras/queries/table_size.sql
ruby-pg-extras-0.7.0 lib/ruby-pg-extras/queries/table_size.sql
pg-stats-1.0.0 queries/table-size.sql
ruby-pg-extras-0.6.2 lib/ruby-pg-extras/queries/table_size.sql
ruby-pg-extras-0.6.1 lib/ruby-pg-extras/queries/table_size.sql
ruby-pg-extras-0.6.0 lib/ruby-pg-extras/queries/table_size.sql
ruby-pg-extras-0.0.3 lib/ruby-pg-extras/queries/table_size.sql
ruby-pg-extras-0.0.2 lib/ruby-pg-extras/queries/table_size.sql
ruby-pg-extras-0.0.1 lib/ruby-pg-extras/queries/table_size.sql
rails-pg-extras-0.5.2 lib/rails-pg-extras/queries/table_size.sql
rails-pg-extras-0.5.1 lib/rails-pg-extras/queries/table_size.sql
rails-pg-extras-0.5.0 lib/rails-pg-extras/queries/table_size.sql