We help IT Professionals succeed at work.
Get Started

does this query can be optimized? how?

Nura111 asked
Last Modified: 2012-08-13
last try on solving a query from the slow log file its seem indexed but the extra doesn't look so good its a word press query ( I tried to get it answered before...)
thats why im not even sure if its smart to change it
# Query_time: 1.990343  Lock_time: 0.000782 Rows_sent: 5  Rows_examined: 3252
SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND ( wp_term_relationships.term_taxonomy_id IN (3) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 5

results from expalin:

id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	wp_posts	index	PRIMARY,type_status_date	PRIMARY	8	NULL	814	Using where; Using temporary; Using filesort
1	SIMPLE	wp_term_relationships	eq_ref	PRIMARY,term_taxonomy_id	PRIMARY	16	chicagw9_wrd10.wp_posts.ID,const	1	Using index

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE