Sha256: 73d9b37085c80a47fa08ad9a7ea4e7b76a709729bc8022cf455172d88b4128c6
Contents?: true
Size: 526 Bytes
Versions: 4
Compression:
Stored size: 526 Bytes
Contents
# frozen_string_literal: true module RailsPGExtras def self.table_indexes_size_description "Total size of all the indexes on each table, descending by size" end def self.table_indexes_size_sql <<-EOS SELECT c.relname AS table, pg_size_pretty(pg_indexes_size(c.oid)) AS index_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='r' ORDER BY pg_indexes_size(c.oid) DESC; EOS end end
Version data entries
4 entries across 4 versions & 1 rubygems