<p>In db/migrate/20140519141742_add_join_table_between_users_and_changesets.rb:</p>
<pre style='color:#555'>> @@ -0,0 +1,11 @@
> +require 'migrate'
> +class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration
> +  def change
> +    create_table :changesets_subscribers, id: false do |t|
> +      t.column :subscriber_id, :bigint, null: false
> +      t.column :changeset_id, :bigint, null: false
> +    end
</pre>
<p>We need to add indexes here on both <code>subscriber_id</code> and <code>changeset_id</code> or things will quickly collapse as we build up subscribers ;-) What I would suggest is a unique index on <code>[:subscriber_id, :changeset_id]</code> which will also make duplicate entries impossible, and an ordinary index on <code>[:changeset_id]</code> for finding the subscribers to a changeset.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/openstreetmap-website/pull/772/files#r15405547">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/1419053__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMTkyMDI5MywiZGF0YSI6eyJpZCI6MzU4NjU3NjJ9fQ==--2ac1bddea109644def041962878a2c2e53c1f908.gif" width="1" /></p>