1.mysql中的join_buffer_size是定义在
class JOIN_CACHE(sql_join_buffer.h) 中的 uchar *buff; void JOIN_CACHE::set_constants() 设置buff的大小 bool JOIN_CACHE::alloc_buffer() 申请buff大小的内存 void JOIN_CACHE::free() join操作完成以后,立马释放内存 void JOIN::destroy() 销毁join类 mysql中每次join操作都会调用my_malloc、my_free函数申请/释放joib_buffer_size的大小的内存。 join_buffer_size是按照每次操作join表的操作的次数申请和释放joib_buffer_size. (gdb) JOIN_CACHE::set_constants Undefined command: "JOIN_CACHE". Try "help". (gdb) br JOIN_CACHE::set_constants Breakpoint 1 at 0x9a8ac9: file /home/os1/Open/mysql5616/sql/sql_join_buffer.cc, line 432. (gdb) br JOIN_CACHE::alloc_buffer Breakpoint 2 at 0x9a8cb0: file /home/os1/Open/mysql5616/sql/sql_join_buffer.cc, line 468. (gdb) r (gdb) br JOIN_CACHE::free (gdb) br JOIN::destroy