Sha256: 80e6a2652b965f2ebb1474ff4c0c925671217c6e09e19d2280b95640d4de3265

Contents?: true

Size: 324 Bytes

Versions: 57

Compression:

Stored size: 324 Bytes

Contents

/* Calculate how many blocks from which table are currently cached */

SELECT c.relname, count(*) AS buffers
FROM pg_class c
INNER JOIN pg_buffercache b ON b.relfilenode = c.relfilenode
INNER JOIN pg_database d ON (b.reldatabase = d.oid AND d.datname = current_database())
GROUP BY c.relname
ORDER BY 2 DESC
LIMIT %{limit};

Version data entries

57 entries across 57 versions & 1 rubygems

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