Home > database >  Two table association, why don't use the index
Two table association, why don't use the index

Time:04-13

Xh_device_record table person_openid for ordinary INDEX,

Drop table if the exists _test;
Create temporary table _test (openid varchar (32));
Insert into _test select '0 a2f0eee010d74368a54ece7d5ab8d56';
Select * from _test;
The explain
Select *
The from _test b
Inner join xh_device_record a on Amy polumbo erson_openid=b.o penid

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# id, select_type, table, partitions, type, possible_keys, key, key_len, ref, rows, filtered, Extra
'1', 'SIMPLE', 'b', NULL, 'ALL', NULL, NULL, NULL, NULL, '1', '100.00' NULL
'1', 'SIMPLE', 'a', NULL, 'ALL', NULL, NULL, NULL, NULL, '1419054', '100.00', 'Using the where; Using the join buffer (Block Nested Loop) '


Don't for MAO xh_device_record person_openid index?
  • Related