一个update如何加强制索引
update a set id=22 where id=1 and time='2332-03-23'
我用explain update a set id=22 where id=1 and time='2332-03-23'是走不通的 , mysql不支持的
1 问 在update可以加强制索引马
2 如果能加, 问该如何加?

解决方案 »

  1.   

    TIMESTAMP[(M)],范围是'1970-01-01 00:00:00'到2037年。
      

  2.   

    可以加,跟select一样加 update a force index(indexname) set id=22 where id=1 and time='2332-03-23' explain只支持select,你要看update的索引使用效果,将update转成同等条件的select看就行了
      

  3.   

    1 问 在update可以加强制索引马 
    2 如果能加, 问该如何加?--------------1、可以 
    2、直接在表名后面加 force index(索引名)