모두 안녕하세요. 저는 현재 조리법에 대해 매우 효율적인 웹 사이트를 구축하고 있습니다.DB 테이블 및 인덱스에 대한 조언 제공
각 조리법에는 10 가지 이하의 성분이 있습니다.
성분이 주어지면 1) 주제가있는 모든 요리법과 2) 1) QUICKLY의 각 요리법에있는 다른 모든 재료를 어떻게 찾을 수 있습니까?
내 초기 계획은 다음과 같습니다. (이유에 대해 설명합니다. 모든 사람이 이해하기 쉽도록 구문이 언어에만 해당하지 않음에 유의하십시오. MySQL에서 먼저이 작업을 수행하고 있으며 가능한 경우, 나는 tokyodb와 같은 기능이 적 으면서 더 빨리 뭔가를 수행하려고 할 것입니다.
Create TABLE mapping:
# This table holds all the names of everything, hopefully storing int
# will cause less IO
id int(32)
name char(32)
index/key (name)
Create table recipes:
# Note that ing1 - ing10 are not nulls, zero will be used for empty
name char(32)
ing1 int(32)
ing2 int(32)
ing3 int(32)
ing4 int(32)
ing5 int(32)
ing6 int(32)
ing7 int(32)
ing8 int(32)
ing9 int(32)
ing10 int(32)
index/key on name
create table relationship:
# This table holds the relationship between ingredients and recipe
ing int(32)
recipe int(32)
key/index on ing
너희들은 어떻게 생각하니? 누군가 더 나은 구현을 생각할 수 있습니까?
조언 -> 조언 – moo