When adding an index to an existing column in Rails:
add_index :users, :some_id
and then running the migrations:
rake db:migrate
Are all pre-existing records/columns automatically indexed? Database used is Postgres.
Yes, it does. It calls postgres CREATE INDEX
that creates an index and fills it with existing data.