<% unless local_assigns[:xhr] %> <% end %> <% if queries.empty? %> <% end %> <% queries.each do |query| %> <% end %>
<%= local_assigns[:sort_headers] ? link_to("Total Time", {sort: nil}, data: {sort: nil}) : "Total Time" %> <%= local_assigns[:sort_headers] ? link_to("Average Time", {sort: "average_time"}, data: {sort: "average_time"}) : "Average Time" %> <%= local_assigns[:sort_headers] ? link_to("Calls", {sort: "calls"}, data: {sort: "calls"}) : "Calls" %>

<% if local_assigns[:xhr] %> No data available for this time. <% else %> ... <% end %>

<%= number_with_delimiter(query["total_minutes"].to_f.round) %> min <% percent = query["total_percent"].to_f %> <% if percent > 1 %> <%= percent.round %>% <% elsif percent > 0.1 %> <%= percent.round(1) %>% <% else %> < 0.1% <% end %> <%= number_with_delimiter(query["average_time"].to_f.round) %> ms <%= number_with_delimiter(query["calls"].to_i) %>
<%= query["query"] %>
<% if query["query"] == "" %>

For security reasons, only superusers can see queries executed by other users.

<% end %> <% if local_assigns[:suggested_indexes] != false && (i2 = @suggested_indexes_by_query[query["query"]]) %> <% if (index = i2[:index]) && !i2[:covering_index] %> <%= render partial: "suggested_index", locals: {index: index} %> <% end %> <% if @debug %>
<% if i2[:explanation] %><%= i2[:explanation] %><% end %>
<% if i2[:row_estimates] %>Rows: <%= i2[:rows] %>
Row estimates: <%= i2[:row_estimates].to_a.map { |k, v| "#{k}=#{v}" }.join(", ") %>
Row progression: <%= i2[:row_progression].to_a.join(", ") %><% end %>
<% end %> <% end %>