11898: Remove superfluous uniq(&:id) call
authorTom Clegg <tom@curoverse.com>
Fri, 23 Jun 2017 19:17:23 +0000 (15:17 -0400)
committerTom Clegg <tom@curoverse.com>
Fri, 28 Jul 2017 14:53:56 +0000 (10:53 -0400)
Avoids adding DISTINCT to SQL query, which causes Postgres to do
expensive things.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curoverse.com>

services/api/app/controllers/application_controller.rb

index 3a66f5328d969d5f56cc02865b6440fbf08cdff8..a3d8f082adf82c3330b034ba0dde581d0ca493b0 100644 (file)
@@ -87,9 +87,6 @@ class ApplicationController < ActionController::Base
   end
 
   def index
-    if @select.nil? || @select.include?("id")
-      @objects = @objects.uniq(&:id)
-    end
     if params[:eager] and params[:eager] != '0' and params[:eager] != 0 and params[:eager] != ''
       @objects.each(&:eager_load_associations)
     end