You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am going through my codebase and cleaning up extraneous indexes and wondered if the fk_follows and fk_followables indexes are needed? i ask because the migration already creates two indexes
classActsAsFollowerMigration < ActiveRecord::Migrationdefself.upcreate_table:follows,force: truedo |t|
...
endadd_index:follows,["follower_id","follower_type"],name: "fk_follows"add_index:follows,["followable_id","followable_type"],name: "fk_followables"end...
end
the main difference is the order of the index elements:
[:follower_type, :follower_id] rather than [:follower_id, :follower_type]
[:followable_type, :followable_id] rather than [:followable_id, :followable_type]
if these two defined indexes are indeed required, then are the implicitly created ones needed? not a huge deal, but i'd thought i'd ask since i couldn't find an answer elsewhere. thanks!
The text was updated successfully, but these errors were encountered:
i am going through my codebase and cleaning up extraneous indexes and wondered if the
fk_follows
andfk_followables
indexes are needed? i ask because the migration already creates two indexesas defined implicitly by these polymorphic references:
so are these two additional indexes required?
the main difference is the order of the index elements:
[:follower_type, :follower_id]
rather than[:follower_id, :follower_type]
[:followable_type, :followable_id]
rather than[:followable_id, :followable_type]
if these two defined indexes are indeed required, then are the implicitly created ones needed? not a huge deal, but i'd thought i'd ask since i couldn't find an answer elsewhere. thanks!
The text was updated successfully, but these errors were encountered: