post_versions/index.html.erb:5: avoid extraneous COUNT.
@post_versions.empty? caused this query:
SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "post_versions" WHERE (true) LIMIT 20 OFFSET 0) subquery_for_count
which is unnecessary since @post_versions can be counted directly.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<div id="a-index">
|
<div id="a-index">
|
||||||
<h1>Changes</h1>
|
<h1>Changes</h1>
|
||||||
|
|
||||||
<% if @post_versions.empty? %>
|
<% if @post_versions.length == 0 %>
|
||||||
<%= render "post_sets/blank" %>
|
<%= render "post_sets/blank" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= render "listing", :post_versions => @post_versions %>
|
<%= render "listing", :post_versions => @post_versions %>
|
||||||
|
|||||||
Reference in New Issue
Block a user