当前位置: 动力学知识库 > 问答 > 编程问答 >

mysql - How Max join size works?

问题描述:

When Using:

mysql>explain extended

select a.included_id, a.portfolio_id

FROM included_transactions a

left join transactions b;

I have an estimation of (31231*132):

id select_type table type possible_keys key key_len ref rows filtered Extra

1 SIMPLE a index portfolio_id 5 31231 100 Using index

1 SIMPLE b ref portfolio_id portfolio_id 5 damsv2.a.portfolio_id 132 100 Using index

But with MAX_join_size=(31231*132)=4122492 is not enough to block the query. I have to set MAX_join_size= almost 770000 to block the query.

Even if it is an estimation how does MySQL know that my query is going to exceed Max_join_size?

分享给朋友:
您可能感兴趣的文章:
随机阅读: