mysql 有视图索引吗?该如何创建?如果MYSQL没有视图索引,那么在视图中查询的时候,是否速度相对建立索引的表慢一点?

解决方案 »

  1.   

    没有,我查过5.x和6.x都没有,手册上是这样说的:
    View processing is not optimized: It is not possible to create an index on a view. Indexes can be used for views processed using the merge algorithm. However, a view that is processed with the temptable algorithm is unable to take advantage of indexes on its underlying tables (although indexes can be used during generation of the temporary tables). 我想应该是慢一点,在手册上我也没有看到类似的说明
      

  2.   

    暂时还没有。
    如果你想看一下哪个慢一点的话,
    用EXPLAIN自己分析一下就可以了。
      

  3.   

    很失望,那MYSQL视图看来还是不用了,没有索引查询会慢很多!