Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

Mysql does not use a best index (no replies)

$
0
0
I have 2 indices:
KEY `I_member_id` (`member_id`),
KEY `I_admin_id` (`admin_id`,`member_id`),

When I make a sql query:
describe select * from bet_1366128000 where admin_id=1 and member_id=4741
The output is:

'1', 'SIMPLE', 'bet_1366128000', 'index_merge', 'I_member_id,I_admin_id', 'I_member_id,I_admin_id', '4,8', NULL, '114974', 'Using intersect(I_member_id,I_admin_id); Using where'

It uses an "index_merge" of 'I_member_id,I_admin_id'. But why doesn't it use only I_admin_id? The I_admin_id is the best one to speed up this query.

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>