MySQL Forums
Forum List  »  Newbie

Re: Another newbie question
Posted by: Rick James
Date: February 13, 2014 11:10PM

> EXPLAIN is below, although it seems to contain the same information as the CREATE TABLE command.

EXPLAIN SELECT ...

> or is it only effective when my query includes all 3 fields in the index?

It is useful for any _left_ prefix. That is,
INDEX(a,b,c)
is useful for
WHERE a=1
WHERE b=1 AND a=2
WHERE a=11 AND c=33 AND b=99
But not
WHERE b=1 (without a)
etc.

> KEY `fk_QSO_User_idx` (`clientID`),

is useless, because there is another index that starts with that. (actually 2 other indexes).

Options: ReplyQuote


Subject
Written By
Posted
February 06, 2014 11:58PM
February 07, 2014 01:11AM
February 07, 2014 06:41AM
February 07, 2014 11:15AM
February 07, 2014 07:50PM
February 08, 2014 11:54AM
February 08, 2014 05:41PM
February 08, 2014 06:55PM
February 08, 2014 06:59PM
February 08, 2014 08:48PM
February 09, 2014 02:56AM
February 09, 2014 07:43PM
February 10, 2014 02:31PM
February 11, 2014 05:10AM
February 11, 2014 10:41AM
February 11, 2014 08:12PM
February 12, 2014 12:50AM
February 12, 2014 08:32AM
February 12, 2014 07:39PM
February 12, 2014 10:47PM
February 12, 2014 11:50PM
February 13, 2014 12:00AM
February 13, 2014 02:14AM
Re: Another newbie question
February 13, 2014 11:10PM
February 16, 2014 12:51AM
February 27, 2014 04:54AM
February 27, 2014 08:47PM


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.