Sha256: de6c860d93de90bae7ec7a2a7accffff1a080258e1acbbe22c2d49b5697ef460

Contents?: true

Size: 367 Bytes

Versions: 14

Compression:

Stored size: 367 Bytes

Contents

/* Total size of all the indexes on each table, descending by size */

SELECT c.relname AS table,
  pg_size_pretty(pg_indexes_size(c.oid)) AS index_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_indexes_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_indexes_size.sql
ruby-pg-extras-1.1.0 lib/ruby-pg-extras/queries/table_indexes_size.sql
ruby-pg-extras-1.0.0 lib/ruby-pg-extras/queries/table_indexes_size.sql
ruby-pg-extras-0.7.0 lib/ruby-pg-extras/queries/table_indexes_size.sql
pg-stats-1.0.0 queries/table-indexes-size.sql
ruby-pg-extras-0.6.2 lib/ruby-pg-extras/queries/table_indexes_size.sql
ruby-pg-extras-0.6.1 lib/ruby-pg-extras/queries/table_indexes_size.sql
ruby-pg-extras-0.6.0 lib/ruby-pg-extras/queries/table_indexes_size.sql
ruby-pg-extras-0.0.3 lib/ruby-pg-extras/queries/table_indexes_size.sql
ruby-pg-extras-0.0.2 lib/ruby-pg-extras/queries/table_indexes_size.sql
ruby-pg-extras-0.0.1 lib/ruby-pg-extras/queries/table_indexes_size.sql
rails-pg-extras-0.5.2 lib/rails-pg-extras/queries/table_indexes_size.sql
rails-pg-extras-0.5.1 lib/rails-pg-extras/queries/table_indexes_size.sql
rails-pg-extras-0.5.0 lib/rails-pg-extras/queries/table_indexes_size.sql