Sha256: 790eb6dec8e6b31de6fcaa5f5b25ac13b09cd3e5c3c8d03b63dfa14211b03d9e

Contents?: true

Size: 394 Bytes

Versions: 18

Compression:

Stored size: 394 Bytes

Contents

/* Number of scans performed on indexes */

SELECT
  schemaname,
  relname AS table,
  indexrelname AS index,
  pg_size_pretty(pg_relation_size(i.indexrelid)) AS index_size,
  idx_scan as index_scans
FROM pg_stat_user_indexes ui
JOIN pg_index i ON ui.indexrelid = i.indexrelid
ORDER BY pg_relation_size(i.indexrelid) / nullif(idx_scan, 0) DESC NULLS FIRST,
pg_relation_size(i.indexrelid) DESC;

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ruby-pg-extras-4.4.4 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-4.4.3 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-4.4.2 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-4.4.1 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-4.4.0 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-4.2.0 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-4.1.0 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-4.0.1 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-4.0.0 lib/ruby_pg_extras/queries/index_scans.sql
ruby-pg-extras-3.3.0 lib/ruby-pg-extras/queries/index_scans.sql
ruby-pg-extras-3.2.7 lib/ruby-pg-extras/queries/index_scans.sql
ruby-pg-extras-3.2.6 lib/ruby-pg-extras/queries/index_scans.sql
ruby-pg-extras-3.2.5 lib/ruby-pg-extras/queries/index_scans.sql
ruby-pg-extras-3.2.4 lib/ruby-pg-extras/queries/index_scans.sql
ruby-pg-extras-3.2.3 lib/ruby-pg-extras/queries/index_scans.sql
ruby-pg-extras-3.2.2 lib/ruby-pg-extras/queries/index_scans.sql
ruby-pg-extras-3.2.1 lib/ruby-pg-extras/queries/index_scans.sql
ruby-pg-extras-3.2.0 lib/ruby-pg-extras/queries/index_scans.sql