Add indices to stats temporary tables
Since we're doing many queries to get stats for each age group and each geozone, testing shows these indices make stats calculation about 25% faster on processes with 100,000 participants.
This commit is contained in:
@@ -174,6 +174,8 @@ module Statisticable
|
||||
temporary: true,
|
||||
as: participants_from_original_table.to_sql
|
||||
)
|
||||
User.connection.add_index participants_table_name, :date_of_birth
|
||||
User.connection.add_index participants_table_name, :geozone_id
|
||||
end
|
||||
|
||||
def drop_participants_table
|
||||
|
||||
Reference in New Issue
Block a user