Sha256: a80e43d633def0a2dbee5123574114e12d68c1843a83624a926344d78d010242

Contents?: true

Size: 354 Bytes

Versions: 32

Compression:

Stored size: 354 Bytes

Contents

/* Index hit rate (effective databases are at 99 percent and up) */

SELECT relname,
   CASE idx_scan
     WHEN 0 THEN 'Insufficient data'
     ELSE (100 * idx_scan / (seq_scan + idx_scan))::text
   END percent_of_times_index_used,
   n_live_tup rows_in_table
 FROM
   pg_stat_user_tables
 WHERE
   schemaname = '%{schema}'
 ORDER BY
   n_live_tup DESC;

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
ruby-pg-extras-5.5.1 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.5.0 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.4.5 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.4.4 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.4.3 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.4.2 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.4.1 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.4.0 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.3.1 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.3.0 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.2.5 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.2.4 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.2.3 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.2.2 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.2.1 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.2.0 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.1.0 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-5.0.0 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-4.13.0 lib/ruby_pg_extras/queries/index_usage.sql
ruby-pg-extras-4.12.2 lib/ruby_pg_extras/queries/index_usage.sql