MySQL Forums
Forum List  »  Newbie

Re: EXPLAIN on SELECT is confusing me
Posted by: john flood
Date: March 17, 2009 10:51AM

Used the below SQL
explain SELECT EDPG_SchAttYearCode as School_Year, 
EDPG_SchAttTermCode as School_Term, 
COUNT(DISTINCT(EDPG_UPN)) AS Total_Pupils 
FROM EDPG_PupilGrouped 
FORCE INDEX (EDPG_YrTermCode) 
LEFT 
JOIN Lookup_PcodeGeo 
ON 
EDPG_Postcode = LKPC_Postcode 
WHERE LKPC_District="Sandwell" 
GROUP 
By 
School_Year, 
School_Term

& it returned
id 	select_type 	table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra
1 	SIMPLE 	EDPG_PupilGrouped 	index 	NULL 	EDPG_YrTermCode 	8 	NULL 	243425 	 
1 	SIMPLE 	Lookup_PcodeGeo 	eq_ref 	PRIMARY,LKPC_District 	PRIMARY 	8 	development.EDPG_PupilGrouped.EDPG_Postcode 	1 	Using where

Is this getting better??

Options: ReplyQuote


Subject
Written By
Posted
Re: EXPLAIN on SELECT is confusing me
March 17, 2009 10:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.