Skip to content

Commit

Permalink
Add indexes to country_uuids.uuid and votes.person_uuid
Browse files Browse the repository at this point in the history
When generating the CSV export we do a join between these two tables on
these two columns. For legislatures with lots of people, like Greece,
this was starting to get very slow on Heroku. This change should help to
keep the CSV export snappy and prevent timeouts.
  • Loading branch information
chrismytton committed Jul 6, 2016
1 parent 9a8b5bc commit 58ffa2e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions db/migrations/018_add_uuid_indexes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Sequel.migration do
change do
alter_table(:country_uuids) do
add_index :uuid
end

alter_table(:votes) do
add_index :person_uuid
end
end
end

0 comments on commit 58ffa2e

Please sign in to comment.