홈 페이지에 sql 쿼리가있어서 홈 페이지가 너무 오래 걸린다.wordpress에서 mysql 쿼리를 실행하는 데 너무 많은 시간이 걸린다.
"select
t1.*,t2.ID,t2.post_title,t2.post_content,t5.name as itemCat,t4.taxonomy as itemType
from
$wpdb->postmeta as t1
inner join $wpdb->posts as t2 on t2.ID=t1.post_id
inner join $wpdb->term_relationships as t3 on t3.object_id=t2.ID
inner join $wpdb->term_taxonomy as t4 on t4.term_taxonomy_id=t3.term_taxonomy_id
inner join $wpdb->terms as t5 on t5.term_id=t4.term_id
where t2.post_status='publish' AND t1.meta_key = '_ait-dir-item' and t1.meta_value
LIKE '%".$url->cityName."%' group by t2.ID,itemType"
모든 색인이 사용 되나요 ?? – Neels
어떻게 인덱스를 만들 수 있습니까? – User1988
"% 기타"는 색인을 사용할 수 없습니다. 그러나 "무엇이든"할 수 있습니다. – Strawberry