如何使用此查询获得更快的结果?
SELECT
post_id
FROM
wp_postmeta
WHERE
meta_key='wpcf-cooler-name' AND (
post_id IN (
SELECT
post_id
FROM
wp_postmeta
WHERE
meta_key='wpcf-cooler-name' AND
meta_value LIKE '%sosa%' AND (
post_id IN (
SELECT
object_id AS 'post_id'
FROM
wp_term_relationships
WHERE
term_taxonomy_id=227
)
) AND (
post_id IN (
SELECT
ID AS 'post_id'
FROM
wp_posts
WHERE
post_type='cooler' AND
post_status='publish'
)
)
)
) ORDER BY meta_value ASC
我的数据库有超过 15000 个条目。因此,显示结果需要时间。