表缓冲工作原理

在对sql语句用explain操作时多出了一个using  john buffer:

   mysql>explain select * from t1,t2 where t1.col<10 and t2.col<'123';

   id     select_type   table   type   extra

   1       simple        t1     range   using  where

   2       simple         t2    range   using where:using john buffer

在没有使用john buffer的mysql服务上,执行下面这个表连接操作:

  table     type         -------                extra              

  tbl1      all

   tbl2      ref                                using where

   tbl3     range                               using where

在没有使用表连接的情况下,mysql服务将执行上述查询语句

 while(t1rec in tbl1)

{

      while(t3rec  in   tbl3 and t3rec.key1<40)

      {

                     put the(t1rec,t2rec,t3rec)combination to output buffer;

       }

}  

 这是没有采用缓冲算法的代码

 对于缓冲算法,下次继续哈。


你可能感兴趣的:(mysql,工作原理,sql语句,where)