X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/db17af19bb75a09494868e002ae6680c6d05cab3..5c734eb7aec2cbab51ae7500c3369e065371638a:/script/statistics diff --git a/script/statistics b/script/statistics index 5a17e8be4..b076bef30 100755 --- a/script/statistics +++ b/script/statistics @@ -53,14 +53,11 @@ begin puts "GPX Files#{day_count}#{week_count}#{month_count}" - day_count = OldNode.count(:user_id, :distinct => true, - :include => :changeset, + day_count = OldNode.count(:user_id, :distinct => true, :joins => :changeset, :conditions => "timestamp > NOW() - '1 DAY'::INTERVAL") - week_count = OldNode.count(:user_id, :distinct => true, - :include => :changeset, + week_count = OldNode.count(:user_id, :distinct => true, :joins => :changeset, :conditions => "timestamp > NOW() - '7 DAYS'::INTERVAL") - month_count = OldNode.count(:user_id, :distinct => true, - :include => :changeset, + month_count = OldNode.count(:user_id, :distinct => true, :joins => :changeset, :conditions => "timestamp > NOW() - '28 DAYS'::INTERVAL") puts "Nodes#{day_count}#{week_count}#{month_count}" @@ -72,13 +69,13 @@ begin puts "DayWeekMonth" day_users = OldNode.count(:conditions => "timestamp > NOW() - '1 DAY'::INTERVAL", - :include => :changeset, :group => :user_id, + :joins => :changeset, :group => :user_id, :order => "count_all DESC") week_users = OldNode.count(:conditions => "timestamp > NOW() - '7 DAYS'::INTERVAL", - :include => :changeset, :group => :user_id, + :joins => :changeset, :group => :user_id, :order => "count_all DESC", :limit => 60) month_users = OldNode.count(:conditions => "timestamp > NOW() - '28 DAYS'::INTERVAL", - :include => :changeset, :group => :user_id, + :joins => :changeset, :group => :user_id, :order => "count_all DESC", :limit => 60) SyncEnumerator.new(day_users, week_users, month_users).each do |row|