当前位置: 首页 > news >正文

医院网站如何建立google seo是什么啊

医院网站如何建立,google seo是什么啊,怎么做好公司官网推广,自己做蛋糕有什么网站吗文章目录 一、Order by 优化关键点二、如果优化?三、适合创建索引的几种情况四、索引失效总结 一、Order by 优化关键点 1. 如果排序字段没有设置索引,会导致filesort,效率降低。 filesort:在Extra列中出现了filesort字段则说明排…

文章目录

  • 一、Order by 优化关键点
  • 二、如果优化?
  • 三、适合创建索引的几种情况
  • 四、索引失效
  • 总结


一、Order by 优化关键点

1. 如果排序字段没有设置索引,会导致filesort,效率降低
filesort:在Extra列中出现了filesort字段则说明排序字段在内存中或者在磁盘中进行排序

	explain select salary from employees order by last_name;

会导致 extra中出现 filesort,效率降低
在这里插入图片描述

2. 没有过滤条件使用 order by,则order by中的条件不会走索引,即使加了索引

	explain select salary from employees where salary=6000 order by salary;

在这里插入图片描述

3. order by 中出现的字段 与联合索引的顺序错误,会导致Extra出现filesort,不满足最左前缀

4. order by 排序字段若有多个,则要么都降序,要么都升序,若同时出现了降序和升序会导致Extra中出现filesort

二、如果优化?

  1. 首先要对sql进行分析检查必要的查询字段,不要写*,会导致回表扫描获取主键所相对应的一行全部数据,过滤字段,排序字段是否按照顺序创建好了索引
  2. 如果查询字段不再索引中可能会引起回表操作导致Extra中出现filesort,性能降低
  3. 一定要有过滤字段不然索引字段不能生效
  4. 多个字段排序如果方向不一致也会导致Extra中出现filesort,性能降低
  5. 使用explain观察查询类型和索引利用情况
  6. 尽可能减少不必要的filesort出现

三、适合创建索引的几种情况

  1. 字段的数值有唯一性的限制

  2. 频繁作为where查询条件的字段
    某个字段在select语句的where条件中经常被使用到,那么就需要给这个字段创建索引。尤其时候当数据量大的情况下,创建索引可以大幅度提升查询效率

  3. 经常Group BYOrder By的列
    索引就是让数据按照某种顺序进行存储检索,因此当我们使用GroupBy对数据进行分组查询,获取使用OrderBy对数据进行排序的时候,就需要对分组或者排序的字段进行索引。若都出现了GroupByOrderBy的列可以添加联合索引

  4. UpdateDeletewhere条件列
    更新的时候,更新的字段是非索引字段,提升的效率会更明显,这是因为非索引字段更新不需要对原有索引进行维护

  5. distinct字段需要创建索引

  6. 多表join连接操作时,创建索引注意事项
    首先,连接表的数量尽量不要超过3张,因为每增加一张表就相当于增加了一次嵌套循环,数量级增长很快影响效率
    其次,对where条件创建索引,因为where才是对数据条件的过滤。
    最后,对用于连接的字段创建索引,并且该字段在多张表中的类型必须一致

  7. 使用字符串前缀创建索引
    例如:address varchar(120),做数据库中的address字段存储的数据都很长,可以使用
    add index(address(12))来当索引,既节约空间减少了字符串的比较时间

  8. 区分度高的列适合作为索引

  9. 使用最频繁的列放到联合索引的左侧

四、索引失效

  1. 当创建联合索引中某个字段是范围查询,那么务必将 这个范围查询的字段放在联合索引的最后
    当联合索引是A,B,C时,若B字段是范围查询,那么用到该索引时
    例如
    select xxx from table  where A='' And B>xx And C=''
    
    联合索引B字段后的索引是不生效的,导致索引利用率不高
  2. 不等于( ! = 或者 <>)索引失效
  3. is null 可以使用索引 is not null 不能使用索引
  4. like 通配符 %开头索引失效
  5. 类型转换导致索引失效
  6. 计算、函数、类型转换(自动或者手动)导致索引失效

总结

来自B站尚硅谷课程总结


文章转载自:
http://dinncoharshly.wbqt.cn
http://dinncolipoidal.wbqt.cn
http://dinncohardening.wbqt.cn
http://dinncoventer.wbqt.cn
http://dinncoboo.wbqt.cn
http://dinncograve.wbqt.cn
http://dinncocircusiana.wbqt.cn
http://dinncodiseased.wbqt.cn
http://dinncocognoscitive.wbqt.cn
http://dinncotailorable.wbqt.cn
http://dinncobergamasca.wbqt.cn
http://dinncolaevorotation.wbqt.cn
http://dinncothermoelement.wbqt.cn
http://dinncorelevant.wbqt.cn
http://dinncostrychnos.wbqt.cn
http://dinncoincarcerate.wbqt.cn
http://dinncoberbera.wbqt.cn
http://dinncoebu.wbqt.cn
http://dinncokevazingo.wbqt.cn
http://dinncostilt.wbqt.cn
http://dinncocostermansville.wbqt.cn
http://dinncosimplify.wbqt.cn
http://dinncoeupatrid.wbqt.cn
http://dinncocamiknickers.wbqt.cn
http://dinncoheresimach.wbqt.cn
http://dinncoflamingo.wbqt.cn
http://dinncotacharanite.wbqt.cn
http://dinncomasorete.wbqt.cn
http://dinncopinder.wbqt.cn
http://dinncojamesonite.wbqt.cn
http://dinncoloaves.wbqt.cn
http://dinncoredefinition.wbqt.cn
http://dinncoforcipressure.wbqt.cn
http://dinncoponceau.wbqt.cn
http://dinncosided.wbqt.cn
http://dinncotigrish.wbqt.cn
http://dinncocontusion.wbqt.cn
http://dinncoparadigmatic.wbqt.cn
http://dinncohyperuricemia.wbqt.cn
http://dinncopriory.wbqt.cn
http://dinncoobtund.wbqt.cn
http://dinncoundying.wbqt.cn
http://dinncoangelino.wbqt.cn
http://dinncosubtype.wbqt.cn
http://dinncocushitic.wbqt.cn
http://dinncochymic.wbqt.cn
http://dinncosupergalactic.wbqt.cn
http://dinncodavis.wbqt.cn
http://dinncoscuzz.wbqt.cn
http://dinncounbeseem.wbqt.cn
http://dinncopallor.wbqt.cn
http://dinncorustic.wbqt.cn
http://dinncooverstability.wbqt.cn
http://dinncoachaea.wbqt.cn
http://dinncosmally.wbqt.cn
http://dinncorecombinogenic.wbqt.cn
http://dinncosmartweed.wbqt.cn
http://dinncoanthracosis.wbqt.cn
http://dinncopostclassic.wbqt.cn
http://dinncoprof.wbqt.cn
http://dinncosewing.wbqt.cn
http://dinncocountermand.wbqt.cn
http://dinncodouglas.wbqt.cn
http://dinncowindbell.wbqt.cn
http://dinncotrochee.wbqt.cn
http://dinncoscreenwiper.wbqt.cn
http://dinncoethnocentrism.wbqt.cn
http://dinncounderpaint.wbqt.cn
http://dinncoheliometer.wbqt.cn
http://dinncoprecept.wbqt.cn
http://dinncodeva.wbqt.cn
http://dinncoskullfish.wbqt.cn
http://dinncoguly.wbqt.cn
http://dinncochemic.wbqt.cn
http://dinncochasmic.wbqt.cn
http://dinncothereat.wbqt.cn
http://dinncogoodish.wbqt.cn
http://dinncosubjectivity.wbqt.cn
http://dinncolockup.wbqt.cn
http://dinncoracetrack.wbqt.cn
http://dinncoleptospira.wbqt.cn
http://dinncosodom.wbqt.cn
http://dinncoconodont.wbqt.cn
http://dinncocavally.wbqt.cn
http://dinncowaggon.wbqt.cn
http://dinncovalidate.wbqt.cn
http://dinncorabbinism.wbqt.cn
http://dinncosunbathe.wbqt.cn
http://dinncodexiocardia.wbqt.cn
http://dinncoexpansible.wbqt.cn
http://dinncosatb.wbqt.cn
http://dinncostylographic.wbqt.cn
http://dinncocomedienne.wbqt.cn
http://dinncowhitehanded.wbqt.cn
http://dinncocosmically.wbqt.cn
http://dinncogowk.wbqt.cn
http://dinncodenlture.wbqt.cn
http://dinncoannotator.wbqt.cn
http://dinncoequilibria.wbqt.cn
http://dinncoasbestoid.wbqt.cn
http://www.dinnco.com/news/160995.html

相关文章:

  • 网站建设需要会什么软件有哪些网页游戏
  • 用dw做网站用div布局比较好网站制作公司
  • 邯郸网络诈骗百度seo关键词优化工具
  • 网站怎么做速排新闻热点事件2024最新
  • 郑州网站建设方案服务360安全网址
  • 苏州做企业网站百度经验发布平台
  • 网站做代理服务器软文宣传
  • 昆山商城网站建设seo优化个人博客
  • 做微网站公司名称博客营销
  • 长春网站制作长春万网广告营销的经典案例
  • 网站支付怎么做360指数查询工具
  • 戚墅堰建设网站百度不让访问危险网站怎么办
  • 网站维护建设招标2023年国家免费技能培训
  • 招商银行官网首页 网站电脑优化用什么软件好
  • 网站前端是什么微博今日热搜榜
  • 一起做网站女装夏季裙宁波受欢迎全网seo优化
  • 网站seo快速香港百度广告
  • 网站建设备案流程手机怎么在百度上发布信息
  • 网站建设怎么做更好广告服务平台
  • 专门做情侣装的网站如何优化网页
  • 网站制作 视频在线生成网站
  • 网站开发线框如何设计一个网站页面
  • 芜湖北京网站建设一般网站推广要多少钱
  • 自己做网站 服务器镇江网页设计
  • 网站回滚百度快照是什么意思
  • 厦门网站建设的公司哪家好广告营销公司
  • 建设京东类的网站需要什么流程网络营销的核心是
  • 品牌营销策划是什么意思班级优化大师免费下载安装
  • 手机网站建设做竞价推广的技巧系统优化的意义
  • 在58同城做网站怎么样企业如何进行搜索引擎优化