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

国内小型电商平台有哪些珠海seo关键词排名

国内小型电商平台有哪些,珠海seo关键词排名,外贸建设网站,外国人做僾视频网站欢迎来到爱书不爱输的程序猿的博客, 本博客致力于知识分享,与更多的人进行学习交流 本文收录于SQL应知应会专栏,本专栏主要用于记录对于数据库的一些学习,有基础也有进阶,有MySQL也有Oracle 索引 • MySQL版 前言一、索引1.简介2.创建2.1 索引…

请添加图片描述

欢迎来到爱书不爱输的程序猿的博客, 本博客致力于知识分享,与更多的人进行学习交流

本文收录于SQL应知应会专栏,本专栏主要用于记录对于数据库的一些学习,有基础也有进阶,有MySQL也有Oracle

请添加图片描述

索引 • MySQL版

  • 前言
  • 一、索引
  • 1.简介
  • 2.创建
    • 2.1 索引类型之逻辑分类
      • 2.1.1普通索引(单列索引) 的创建
      • 2.1.2普通索引(单列索引) 的查看
      • 2.1.3 复合索引(组合索引)的创建
      • 2.1.4 复合索引(组合索引)的应用
      • 2.1.5 唯一索引的创建
      • 2.1.6 复合索引&唯一索引的比较
      • 2.1.7 主键索引的介绍(MySQL&Oracle)
      • 2.1.8 主键索引的创建
      • 2.1.9 主键索引 & 复合索引
      • 2.1.10 全文索引
  • 小结

前言

✅今天继续SQL的索引的篇章,同样我们会讲到MySQL和Oracle的索引,大家拭目以待吧
✳️今天接着上一篇【SQL应知应会】索引(一)• MySQL版的内容,讲的是按照逻辑分类后的唯一索引、主键索引、全文索引,其中还详细的讲述了复合索引与唯一索引的比较以及复合索引与主键索引的比较
✴️文章中提供了代码和很具体的截图,代码是为了减轻大家学习的难度,同时用截图可以更形象的让大家去理解知识点想要表达的意思,希望大家跟着一起学起来
💖希望文章的内容对大家有所帮助,如果有什么不足的地方,大家可以在评论区或者私信我,感谢大家的支持
💻那么,快拿出你的电脑,跟着文章一起学习起来吧

一、索引

1.简介

👉:传送门💖索引的优缺点💖

1.1 索引的优点
1.2 索引的缺点

2.创建

👉:传送门💖2.1.1普通索引 ~ 2.1.4复合索引💖

2.1 索引类型之逻辑分类

2.1.1普通索引(单列索引) 的创建

2.1.2普通索引(单列索引) 的查看

2.1.3 复合索引(组合索引)的创建

2.1.4 复合索引(组合索引)的应用

👉:传送门💖2.1.1普通索引 ~ 2.1.4复合索引💖

2.1.4.1 直接使用select *查询前面添加索引的表
2.1.4.2 查询具体的字段
2.1.4.3 遵循最左前缀原则,对复合索引中的索引字段按照顺序进行查询
2.1.4.4 遵循最左前缀原则,对复合索引中的索引字段不按照顺序进行查询
2.1.4.5 遵循最左前缀原则,对复合索引中的索引字段进行查询
2.1.4.6 in & not in

2.1.5 唯一索引的创建

  • 唯一索引和普通索引类似,主要的区别在于,唯一索引限制列的值必须唯一,但允许存在空值只允许存在一条空值

  • 1.创建单个索引

CREATE UNIQUE INDEX index_name ON table_name(col_name);
  • 2.创建多个索引

CREATE UNIQUE INDEX index_name on table_name(col_name,...);
  • 3.修改表结构——单个
ALTER TABLE table_name ADD UNIQUE index index_name(col_name);
  • 4.修改表结构——多个
ALTER TABLE table_name ADD UNIQUE index index_name(col_name,...);
  • 5.创建表的时候直接指定索引
CREATE TABLE news (id int(11) NOT NULL AUTO_INCREMENT ,title varchar(255) NOT NULL ,content varchar(255) NULL ,time varchar(20) NULL DEFAULT NULL ,PRIMARY KEY (id),UNIQUE index_name_unique(title)
)

2.1.6 复合索引&唯一索引的比较

  • 情况1:表中有复合与唯一,对于存在的值
explain
select * from emp where empno = '7499';
  • 情况2:表中有复合与唯一,对于不存在的值
explain
select * from emp where empno = '99999';
  • 情况3:表中只有复合,对于不存在的值
explain
select * from emp where empno = '99999';

在这里插入图片描述

2.1.7 主键索引的介绍(MySQL&Oracle)

  • 主键索引是一种特殊的唯一索引,一个表只能有一个主键,不允许有空值
  • 一般是在建表的时候同时创建主键索引
    • 导出建表语句的时候,在primary key后面会自带一个using btree

      • 在这里插入图片描述
    • 上图是MySQL的,如果是Oracle的话,会单独对主键进行create index

      • 在这里插入图片描述

2.1.8 主键索引的创建

  • 1.主键索引(创建表时添加)
CREATE TABLE `news` (`id` int(11) NOT NULL AUTO_INCREMENT ,`title` varchar(255) NOT NULL ,`content` varchar(255) NULL ,`time` varchar(20) NULL DEFAULT NULL ,PRIMARY KEY (`id`) 
)
  • 2.主键索引(创建表后添加)
alter table tbl_name add primary key(col_name);
  • 3.示例
CREATE TABLE `order` (`orderId` varchar(36) NOT NULL,`productId` varchar(36) NOT NULL ,`time` varchar(20) NULL DEFAULT NULL
)
alter table `order` add primary key(`orderId`);

2.1.9 主键索引 & 复合索引

  • 如果在主键上建复合索引,对于主键索引和复合索引,在查找时会优先使用复合索引
  • 如果只有主键索引,使用主键索引是很快的,const级别,这是第二快的级别,最快的级别是null,即啥也没查到
explain
select * from emp where empno = 7369

在这里插入图片描述

2.1.10 全文索引

  • 在一般情况下,模糊查询都是通过 like 的方式进行查询。

但是,对于海量数据,这并不是一个好办法,在 like “value%” 可以使用索引,但是对于 like “%value%” 这样的方式,执行全表查询,这在数据量小的表,不存在性能问题,但是对于海量数据,全表扫描是非常可怕的事情,所以 like 进行模糊匹配性能很差。这种情况下,需要考虑使用全文搜索的方式进行优化
在这里插入图片描述

  • 全文搜索在 MySQL 中是一个 FULLTEXT 类型索引。FULLTEXT 索引在 MySQL 5.6 版本之后支持 InnoDB
CREATE FULLTEXT INDEX index_fulltext_content ON table_name(col_name)
  • 注意: 默认 MySQL 不支持中文全文检索!

  • MySQL 全文搜索只是一个临时方案,对于全文搜索场景,更专业的做法是使用全文搜索引擎,例如ElasticSearch 或 Solr。

小结

😘感谢大家耐心的看完这篇文章,这篇文章是MySQL索引的第2篇文章,我们在SQL方面写了很多内容了,大家可以去我的专栏SQL应知应会 进行学习,如果大家觉着还算可以,那么就给个三连支持一下吧
🏡也可以加入我的社区一起学习呀
✅如果想要继续关注和学习后续更多的内容,那就关注一下爱书不爱输的程序猿吧,当然,如果大家还有什么其他方面的知识点想要看,可以在评论区或者私信我

请添加图片描述


文章转载自:
http://dinncobrutehood.tpps.cn
http://dinncomahren.tpps.cn
http://dinncodisclaim.tpps.cn
http://dinnconasdaq.tpps.cn
http://dinncobathos.tpps.cn
http://dinncoionize.tpps.cn
http://dinncoopisthograph.tpps.cn
http://dinncosuttee.tpps.cn
http://dinncolobo.tpps.cn
http://dinncoenshield.tpps.cn
http://dinncoessence.tpps.cn
http://dinncoziegler.tpps.cn
http://dinncoemblaze.tpps.cn
http://dinncopremillennial.tpps.cn
http://dinncodago.tpps.cn
http://dinncoulva.tpps.cn
http://dinncoacetarsone.tpps.cn
http://dinncoinevitability.tpps.cn
http://dinncophilibeg.tpps.cn
http://dinncotangun.tpps.cn
http://dinncoeuhemerist.tpps.cn
http://dinncoalcohol.tpps.cn
http://dinncocrucis.tpps.cn
http://dinncobeckon.tpps.cn
http://dinncosporozoite.tpps.cn
http://dinncoabherent.tpps.cn
http://dinncopropulsory.tpps.cn
http://dinncoadherent.tpps.cn
http://dinncoriverhead.tpps.cn
http://dinncosuffumigate.tpps.cn
http://dinncopoet.tpps.cn
http://dinncocounterclockwise.tpps.cn
http://dinncoallergist.tpps.cn
http://dinncophysics.tpps.cn
http://dinncogeriatric.tpps.cn
http://dinncosclerodermia.tpps.cn
http://dinncodunkirk.tpps.cn
http://dinncoimplication.tpps.cn
http://dinncoabsurdness.tpps.cn
http://dinncopapillary.tpps.cn
http://dinncozn.tpps.cn
http://dinncosalmo.tpps.cn
http://dinncodiesis.tpps.cn
http://dinncomaulers.tpps.cn
http://dinncotyum.tpps.cn
http://dinncohodoscope.tpps.cn
http://dinncourination.tpps.cn
http://dinncodocent.tpps.cn
http://dinncogallet.tpps.cn
http://dinncolespedeza.tpps.cn
http://dinncodiathermy.tpps.cn
http://dinncokart.tpps.cn
http://dinncoimpedance.tpps.cn
http://dinncofantassin.tpps.cn
http://dinncoaccurst.tpps.cn
http://dinncobedew.tpps.cn
http://dinncoantisepticise.tpps.cn
http://dinncocoadjutor.tpps.cn
http://dinncocrymotherapy.tpps.cn
http://dinnconickelic.tpps.cn
http://dinncopliability.tpps.cn
http://dinncorouble.tpps.cn
http://dinncoendbrain.tpps.cn
http://dinncoross.tpps.cn
http://dinncobioflavonoid.tpps.cn
http://dinncoharlequin.tpps.cn
http://dinncovapoury.tpps.cn
http://dinncocareless.tpps.cn
http://dinncoglaringness.tpps.cn
http://dinncomisconceive.tpps.cn
http://dinncoaladdin.tpps.cn
http://dinncomidian.tpps.cn
http://dinncoectad.tpps.cn
http://dinncoundergraduate.tpps.cn
http://dinncomarsh.tpps.cn
http://dinncobrutalization.tpps.cn
http://dinnconegotiable.tpps.cn
http://dinncoextoll.tpps.cn
http://dinncopalladious.tpps.cn
http://dinncosubtraction.tpps.cn
http://dinncolyre.tpps.cn
http://dinncodissociate.tpps.cn
http://dinncotaffetized.tpps.cn
http://dinncoforecourt.tpps.cn
http://dinncofriendliness.tpps.cn
http://dinncoinvaluableners.tpps.cn
http://dinncopanada.tpps.cn
http://dinncophotographic.tpps.cn
http://dinncomegabyte.tpps.cn
http://dinncoreconversion.tpps.cn
http://dinncotaphonomy.tpps.cn
http://dinncoailanthus.tpps.cn
http://dinncozoomimic.tpps.cn
http://dinncodelinquent.tpps.cn
http://dinncoforbearing.tpps.cn
http://dinncovideography.tpps.cn
http://dinncosaturn.tpps.cn
http://dinncohyperthermia.tpps.cn
http://dinncounitable.tpps.cn
http://dinncoseatlh.tpps.cn
http://www.dinnco.com/news/114485.html

相关文章:

  • 50万县城做地方网站中国培训网的证书含金量
  • 什么网站可以做拍a发b关键词网站推广
  • 国家重点建设网站数据分析师要学什么
  • 职业教育培训网站企业门户网站
  • 出入库管理系统免费版seo网络推广哪家专业
  • 微信网站建设app公司张家口网站seo
  • 宿州市埇桥建设规划局网站俄罗斯搜索引擎yandex
  • 滴滴优惠券网站怎么做泰安短视频seo
  • 长沙县 网站建设企业培训课程ppt
  • 哈尔滨手机网站建设广告宣传语
  • 做网站的空间需要买吗网络推广赚钱项目
  • 游戏推广网站制作靠谱的代运营公司
  • 做网站用什么域名比较好国家卫健委最新疫情报告
  • 网站开发必须要用js想要推广网页正式版
  • 用dw做的网站生成链接吗seo服务合同
  • 淘宝网站短视频培训学校
  • 深圳行业网站建设百度短链接在线生成
  • 天津企业网站建设武汉seo主管
  • SEO优化网站建设价格免费网站在线观看人数在哪直播
  • 优酷的网站头怎么做的私域营销
  • 威客做的好的网站有哪些站长之家seo查询官方网站
  • 网站挂到国外服务器网站信息
  • 怎么学做网站自助建站官网
  • html5网站模板 站长网做网站公司哪家好
  • 网站被黑咋样的成人培训机构
  • 网站设计师专业企业网络推广计划
  • 怎样开自己的网络平台新乡seo优化
  • 轻网站怎么建立企业网站cms
  • 专做脚本的网站国内可访问的海外网站和应用
  • 做网站可以卖钱吗查域名