原sql:sql
SELECT biv.*, m.`name` media_name, cp.`name` cp_name, m.type media_type FROM bi_validcount_day biv
LEFT JOIN z_media_local zm ON biv.media_id = zm.local_id AND biv.platform_id = zm.platform_id
LEFT JOIN x_media m ON zm.entity_code = m.`code`
LEFT JOIN x_content_provider cp ON m.content_provider_id = cp.id
WHERE biv.day >='2019-08-09' AND biv.day <= '2019-08-15' AND biv.platform_id = '5'ide
改成:code
SELECT biv.*, m.`name` media_name, cp.`name` cp_name, m.type media_type FROM bi_validcount_day biv
INNER JOIN z_media_local zm ON biv.media_id = zm.local_id AND biv.platform_id = zm.platform_id
INNER JOIN x_media m ON zm.entity_code = m.`code`
INNER JOIN x_content_provider cp ON m.content_provider_id = cp.id
WHERE biv.day >='2019-08-09' AND biv.day <= '2019-08-15' AND biv.platform_id = '5'orm
速度快了不少 可是結果集條數都一致。it
目前在查詢緣由form