Sha256: 4e4dd7c58ed38035401904487c0979b9e20b112d8c6738d4ae74952794fb0e5b

Contents?: true

Size: 327 Bytes

Versions: 50

Compression:

Stored size: 327 Bytes

Contents

/* Index and table hit rate */

SELECT
  'index hit rate' AS name,
  (sum(idx_blks_hit)) / nullif(sum(idx_blks_hit + idx_blks_read),0) AS ratio
FROM pg_statio_user_indexes
UNION ALL
SELECT
 'table hit rate' AS name,
  sum(heap_blks_hit) / nullif(sum(heap_blks_hit) + sum(heap_blks_read),0) AS ratio
FROM pg_statio_user_tables;

Version data entries

50 entries across 50 versions & 3 rubygems

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