[ARVADOS] created: 69f592e029493afb8a0709811b5be1fefabafb4b

git at public.curoverse.com git at public.curoverse.com
Wed Jun 3 15:54:34 EDT 2015


        at  69f592e029493afb8a0709811b5be1fefabafb4b (commit)


commit 69f592e029493afb8a0709811b5be1fefabafb4b
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Jun 3 15:39:01 2015 -0400

    6074: Speed up db query by using octet_length() instead of length(). closes #6223

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 6810d91..e6a02b1 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -302,7 +302,7 @@ class ApplicationController < ActionController::Base
     model_class.transaction do
       limit_query = @objects.
         select("(%s) as read_length" %
-               limit_columns.map { |s| "length(#{s})" }.join(" + "))
+               limit_columns.map { |s| "octet_length(#{s})" }.join(" + "))
       new_limit = 0
       read_total = 0
       limit_query.find_each do |record|

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list