Maintenance

<% if @show_dead_rows %> <% end %> <% @maintenance_info.each do |table| %> <% if @show_dead_rows %> <% end %> <% end %>
Table Last Vacuum Last AnalyzeDead Rows
<%= table[:table] %> <% if table[:schema] != "public" %> <%= table[:schema] %> <% end %> <% time = [table[:last_autovacuum], table[:last_vacuum]].compact.max %> <% if time %> <%= l time.in_time_zone(@time_zone), format: :short %> <% else %> Unknown <% end %> <% time = [table[:last_autoanalyze], table[:last_analyze]].compact.max %> <% if time %> <%= l time.in_time_zone(@time_zone), format: :short %> <% else %> Unknown <% end %> <% if table[:live_rows] != 0 %> <%# use live rows only for denominator to make it easier to compare with autovacuum_vacuum_scale_factor %> <%# it's not a true percentage, since it can go above 100% %> <%= (100.0 * table[:dead_rows] / table[:live_rows]).round %>% <% else %> Unknown <% end %>