I understand why the index order matters in Rails (from answers like these), for example, if I have:
add_index :admin_users_pages, ["user_id", "page_id"]
So I'm supposed to put the field that "narrows down the number of rows" fastest, but I'm not sure what does that mean. Say I have 2 users, with 2 unique IDs, and 300 pages, with 300 unique IDs, which one would be a smarter choice to put first? Say I have 150 pages for the first user and 150 pages for the second user, would the index look something like:
user_id page_id
1 1
1 2
1 3
or the page_id won't be sorted at all, only the index so I should get something like:
user_id page_id
1 143
1 93
1 31