'Getting slow query. What column should I index and what type of index?
I'm new to MySQL. I'm getting this slow query below.
# Query_time: 3.357236 Lock_time: 0.000054 Rows_sent: 1 Rows_examined: 107494
# Rows_affected: 0 Bytes_sent: 67
SET timestamp=1652612113;
SELECT COUNT(*) FROM et_term_relationships, et_posts WHERE et_posts.ID = et_term_relationships.object_id AND post_status IN ('publish') AND post_type IN ('acadp_listings') AND term_taxonomy_id = 15;
What index (with what columns) should I create and what type of index should I use (PRIMARY KEY, UNIQUE, INDEX, FULLTEXT)?
Any help is appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
