mySQL command Explain ignore LIMIT? -


i use mysql server version 5.5.14 , trying simple sql query explain command:

explain select id, name, thumb `twitter_profiles` limit 10; 

and shows me result:

+----+-------------+-------+------+---------------+------+---------+------+-------+-------+ | id | select_type | table | type | possible_keys | key  | key_len | ref  | rows  | | +----+-------------+-------+------+---------------+------+---------+------+-------+-------+ |  1 | simple      | tp    |  | null          | null | null    | null | 40823 |       | +----+-------------+-------+------+---------------+------+---------+------+-------+-------+ 1 row in set (0.02 sec) 

my question why scans whole table instead of taking first 10 rows specified in limit clause?

thank advice in advance!

cheers,

jakub

here link of article mysql explain limits , errors

limit not taken account while estimating number of rows if have limit restricts how many rows examined mysql still print full number


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -