(cost=0.28..1.31 rows=1 width=8) Index Cond: (project_id = wikis.project_id) Filter: ((name)::text = 'wiki'::text) MariaDB10 +------+--------------+-------------+--------+----------------------------+--------------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +------+--------------+-------------+--------+----------------------------+--------------+---------+------+------+-------------+ | 1 | PRIMARY | <subquery2> | eq_ref | distinct_key | distinct_key | 4 | func | 1 | | | 2 | MATERIALIZED | em | ALL | enabled_modules_project_id | NULL | NULL | NULL | 3499 | Using where | +------+--------------+-------------+--------+----------------------------+--------------+---------+------+------+-------------+ キーを使用せず、行数がふくれる →MySQL8でも実行計画は変わらず メインテーブルのキーを使用