一般的nested loop join都是把内存分为3块,一块用来存放较小的TABLE,一块用来存放较大TABLE的一部分,一块用来存放结果准备输出.
请问在MYSQL里的JOIN_BUFFER也是这么分的吗? 还是JOIN_BUFFER只负责存放JOIN的两个TABLE?
另外BUFFER分配的比例是怎么样了?
还想请教下SORT操作时SORT_BUFFER的分配是怎么样的呢?
最好能提供相关函数 谢谢
请问在MYSQL里的JOIN_BUFFER也是这么分的吗? 还是JOIN_BUFFER只负责存放JOIN的两个TABLE?
另外BUFFER分配的比例是怎么样了?
还想请教下SORT操作时SORT_BUFFER的分配是怎么样的呢?
最好能提供相关函数 谢谢
Table Join Type
t1 range
t2 ref
t3 ALL
If a simple NLJ algorithm is used, the join would be processed like this:
for each row in t1 matching range {
for each row in t2 matching reference key {
for each row in t3 {
if row satisfies join conditions,
send to client
}
}
}
Because the NLJ algorithm passes rows one at a time from outer loops to inner loops, tables processed in the inner loops typically are read many times.