クエリを高速化する必要があります。インデックステーブルは私が探しているものですか?もしそうなら、どうすればそれを作ることができますか?挿入するたびに更新する必要がありますか?
テーブルスキーマは次のとおりです。
--table1-- | --tableA-- | --table2--
id | id | id
attrib1 | t1id | attrib1
attrib2 | t2id | attrib2
| attrib1 |
そしてクエリ:
SELECT
table1.attrib1,
table1.attrib2,
tableA.attrib1
FROM
table1,
tableA
WHERE
table1.id = tableA.t1id
AND (tableA.t2id = x or ... or tableA.t2id = z)
GROUP BY
table1.id