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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -