Reputation: 2080
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.
Upvotes: 1
Views: 346
Reputation: 23317
Yes, it does. It calls postgres CREATE INDEX
that creates an index and fills it with existing data.
Upvotes: 5