OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Indexed Query examining too many rows!

From: Cabbar Duzayak (cabbargmail.com)
Date: Sun Feb 12 2012 - 16:25:00 CST


Hi All,

I have a table with a btree index on its searchKey column, and when I
send a simple query on this table:

explain select * from DataIndex where (searchKey like 'A%') order by
searchKey limit 10

rows is returning 59548 and it tells me that it is using the searchKey index.

Also, a select count(*) on this table returns 32104 rows, i.e.

select count(*) from DataIndex where searchKey like 'a%' -> gives
32104 as its result

Am I doing something wrong here? Given that the searched column is
indexed, shouldn't it examine way less rows?

Thanks.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql