Space

Database Size: <%= @database_size %>

<% if @system_stats_enabled %>
Loading...
<% end %> <% if @unused_indexes.any? %>

<%= pluralize(@unused_indexes.size, "unused index") %>. Remove them <% if @show_migrations %> with a migration <% end %> for faster writes. <% if @database.replicating? %> Check they aren’t used on replicas. <% end %>

<% end %> <% if @space_stats_enabled %> <% end %> <% @relation_sizes.each do |query| %> <% if @space_stats_enabled %> <% end %> <% end %>
<%= link_to (@only_tables ? "Table" : "Relation"), @header_options.merge(sort: "name") %> <%= link_to "Size", @header_options %><%= link_to "#{@days}d Growth", @header_options.merge(sort: "growth") %>
"> <% name = query[:relation] || query[:table] %> <% if @space_stats_enabled %> <%= link_to name, relation_space_path(name, schema: query[:schema]), target: "_blank", style: "color: inherit;" %> <% else %> <%= name %> <% end %> <% if query[:schema] != "public" %> <%= query[:schema] %> <% end %> <% if @unused_index_names.include?(query[:relation]) %> UNUSED <% end %> <%= query[:size] %> <% if @growth_bytes_by_relation[[query[:schema], query[:relation]]] %> <% if @growth_bytes_by_relation[[query[:schema], query[:relation]]] < 0 %>-<% end %><%= PgHero.pretty_size(@growth_bytes_by_relation[[query[:schema], query[:relation]]].abs) %> <% else %> Unknown <% end %>