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-5.2.5 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-5.2.4 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-5.2.3 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-5.2.2 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-5.2.1 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-5.2.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-5.1.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-5.0.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.13.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.12.2 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.12.1 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.12.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.11.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.10.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.9.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.8.1 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.7.2 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.7.1 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.7.0 lib/ruby_pg_extras/queries/index_size.sql
ruby-pg-extras-4.6.0 lib/ruby_pg_extras/queries/index_size.sql