Home > database > Mysql under what circumstances, please add the indexing speed slower instead?
Mysql under what circumstances, please add the indexing speed slower instead?
Time:12-23
If involves disk read and random sequence, but hasn't been too understand, what bosses can give small white about [face] monkey2:053 PNG [/face] [face] monkey2:053 PNG [/face] [face] monkey2:053 PNG [/face]
CodePudding user response:
select val_1, avg (val_2) The from big_table Where val_3=1 Group by val_1
Big_table article to tens of millions of data query speed before add index more than 4 s, but after add the index:
the create index i_2 on big_table (val_3 val_1);
Query speed dropped more than 9 s,,,,
This is why ah,,,
CodePudding user response:
The execution plan left
CodePudding user response:
Tens of millions of data, if val_3=1 than big , then this index is not worth it, As table scan before indexing, instead