美文网首页
mysql分库分表

mysql分库分表

作者: bettermeLy | 来源:发表于2018-09-26 13:41 被阅读0次

    1、shard表查询必须带shardingkey

    2、explain select * from table where a = 123 and b = 0 order by c desc;

    查询优化需要设置三个字段索引ix_a_b_c

    sql优化:http://blog.51cto.com/ustb80/1073352

    3、explain select * from table where a = 123 and b in (1,2) and c = 0;

    如果不使用in  命中ix_b索引

    如果使用in  需要建立ix_a_b_c索引

    4、索引优化:https://my.oschina.net/longniao/blog/110384

    5、简书索引失效:https://www.jianshu.com/p/932bcdf2c89f

    相关文章

      网友评论

          本文标题:mysql分库分表

          本文链接:https://www.haomeiwen.com/subject/ajvdoftx.html