Permalink
Browse files

Optimize get_total_number_of_warcs query; address #241.

  • Loading branch information...
ruebot committed Jan 8, 2019
1 parent 3acdb19 commit 5a1c4f226629481b2c04804c799ab6d957b422cf
Showing with 5 additions and 1 deletion.
  1. +5 −1 app/helpers/dashboards_helper.rb
@@ -75,7 +75,11 @@ def get_largest_collection_title
end

def get_total_number_of_warcs
WasapiFile.distinct.count(:filename)
total_warcs = <<-QUERY
SELECT COUNT(*) FROM (SELECT DISTINCT "wasapi_files"."filename"
FROM "wasapi_files") AS temp;
QUERY
ActiveRecord::Base.connection.execute(total_warcs).first.first.second
end

def get_total_number_of_collections

0 comments on commit 5a1c4f2

Please sign in to comment.