<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>My understanding is you want the more selective first in composite indexes, which probably means a unique index on <code>[:changeset_id, :subscriber_id]</code> and <code>[:subscriber_id]</code> for the other.</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#r15546822">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/1419053__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMjI4MTg4OCwiZGF0YSI6eyJpZCI6MzU4NjU3NjJ9fQ==--95a650f5d93eca8e3dd3ba88e377d9639d0e6a81.gif" width="1" /></p>