【发布时间】:2014-10-26 16:10:21
【问题描述】:
我在 Rails 中见过几次以下迁移:
create_join_table :customers, :products do |t|
# t.index [:customer_id, :product_id]
# t.index [:product_id, :customer_id]
end
我不明白为什么我们需要两次声明同一个索引,或者索引中列的顺序有很大的优先级?它会提高查询速度吗?提前致谢。
【问题讨论】:
标签: sql ruby-on-rails