zoukankan      html  css  js  c++  java
  • 索引优化

    性能下降sql慢!执行时间场等待时间长

    索引失效:单值   复合  

    joins 连接语句

    内连接:select * from  tableA A inner join tableB B on a.ket=b.key (两个表的交集)

    左连接:select * from tableA A left join tableB B on A.key=B.key (左表的所有加两表的交集)

    右连接:select * from tableA A right join tableB B on A.key=B.key (右表的所有加两表的交集)

    左差集:select * from tableA A left join tableB B on A.key=B.key where b.key is null 

    右差集:select * from tableA A right join tableB B on A.key=B.key where b.key is null

    全连接:select * from tableA A full outter join tableB B on A.key=B.key   (mysql不支持) 可以用(左连接  union 右连接) 来代替

    两表独有的: select * from tableA A full outer join table B B on A.key=B.key where A.key is null or B.key is null     

    (mysql不支持) 可以用(左差集  union 右差集) 来代替

    什么是索引:是一种数据结构,他能够帮助sql高效的获取数据。

    排好序的快速查找数据结构。

    劣势:、

    索引失效

    快速插入大量的数据 (先创建函数,然后创建存储过程)

    随机生成部门编号

    调用

  • 相关阅读:
    xtrabackup
    spark对机器的要求
    hbase的总结
    TO B公司高效能的组织建设实践
    如何给客户展示实力
    什么样的IT队伍是好队伍
    程序员如何使用OKR
    云原生
    Flink 的18个小知识点
    apt 常用命令
  • 原文地址:https://www.cnblogs.com/shxkey/p/11312330.html
Copyright © 2011-2022 走看看