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高效的获取数据。

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

    劣势:、

    索引失效

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

    随机生成部门编号

    调用

  • 相关阅读:
    关于研发岗位怎样做新人培训
    打工人的出路
    箭头函数的副作用
    前端日志系统设计
    cocos creator3d开发插件
    linux+Docker+asp.netCore部署
    asp.net core API 3.1获取图片返回流文件
    asp.net Core API 获取ip地址
    asp.net core 3.1配置log4net
    Asp.net Core JsonWebToken记录
  • 原文地址:https://www.cnblogs.com/shxkey/p/11312330.html
Copyright © 2011-2022 走看看