Sha256: bd6cf306c2fd8b3a47a6f9dc3d1865eb06f3ace3456b00a3649caa426f5830d7

Contents?: true

Size: 362 Bytes

Versions: 72

Compression:

Stored size: 362 Bytes

Contents

/* The size of indexes, descending by size */

SELECT c.relname AS name,
  pg_size_pretty(sum(c.relpages::bigint*8192)::bigint) 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='i'
GROUP BY c.relname
ORDER BY sum(c.relpages) DESC;

Version data entries

72 entries across 72 versions & 3 rubygems

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