Database
-
외래키 필드에 인덱스를 수동으로 추가해야합니까? 아니면 Rails가 자동으로 수행합니까?카테고리 없음 2020. 8. 16. 14:29
질문 외래 키 필드에 적용된 인덱스가 응용 프로그램 속도 성능에 얼마나 중요한지에 대해 읽었지만 이를 설정하는 방법에 대한 모순된 설명도 읽었습니다. 아래 내 모델 및 마이그레이션 파일에 표시된 구조에서 : class Owner < ApplicationRecord has_many :dogs end class Dog < ApplicationRecord belongs_to :owner end create_table :owners do |t| t.string :full_name t.string :address t.timestamps end create_table :dogs do |t| t.string :name t.string :age t.string :breed t.references :owner, fore..