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

南宁网站提升排名成都现在可以正常出入吗

南宁网站提升排名,成都现在可以正常出入吗,为什么做视频网站违法,网上做衣服的网站有哪些在MySQL中#xff0c;即使表中没有数据#xff0c;查询优化器也会考虑使用索引来执行查询。但在某些情况下#xff0c;查询优化器可能会选择不使用索引#xff0c;这通常是基于成本效益分析的结果。 表中没有任何数据时#xff0c;无论是否使用索引#xff0c;查询结果都…在MySQL中即使表中没有数据查询优化器也会考虑使用索引来执行查询。但在某些情况下查询优化器可能会选择不使用索引这通常是基于成本效益分析的结果。 表中没有任何数据时无论是否使用索引查询结果都是一样的。但直接扫描表全表扫描可能比使用索引更快因为即使是空表访问索引也需要一定的开销但并不会带来性能提升。 create table test(id int primary key, name varchar(10)); Query OK, 0 rows affected (0.10 sec)mysql explain select * from test where id1; ------------------------------------------------------------------------------------------------------------------------------ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | ------------------------------------------------------------------------------------------------------------------------------ | 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | no matching row in const table | ------------------------------------------------------------------------------------------------------------------------------ 1 row in set, 1 warning (0.00 sec)mysql insert into test value(1, a); Query OK, 1 row affected (0.01 sec)mysql explain select * from test where id1; ---------------------------------------------------------------------------------------------------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | ---------------------------------------------------------------------------------------------------------- | 1 | SIMPLE | test | NULL | const | PRIMARY | PRIMARY | 4 | const | 1 | 100.00 | NULL | ---------------------------------------------------------------------------------------------------------- 1 row in set, 1 warning (0.00 sec)使用如下SQL语句建表并使用b列作为条件查询。按照索引最左匹配原则此时应该无法使用索引。但如果表中只包含主键列和索引列此时查询优化器还是会使用索引。示例如下 CREATE TABLE t1 (id int NOT NULL,a int DEFAULT NULL,b int DEFAULT NULL,c int DEFAULT NULL,PRIMARY KEY (id),KEY inx_abc (a,b,c) );CREATE TABLE t2 (id int NOT NULL,a int DEFAULT NULL,b int DEFAULT NULL,c int DEFAULT NULL,d int DEFAULT NULL,PRIMARY KEY (id),KEY inx_abc (a,b,c) );# 插入两条数据 insert into t1 value(1, 1, 1, 1); insert into t2 value(1, 1, 1, 1, 1); explain select * from t1 where b1; ---------------------------------------------------------------------------------------------------------------------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | ---------------------------------------------------------------------------------------------------------------------------- | 1 | SIMPLE | t1 | NULL | index | inx_abc | inx_abc | 15 | NULL | 1 | 100.00 | Using where; Using index | ---------------------------------------------------------------------------------------------------------------------------- 1 row in set, 1 warning (0.00 sec) explain select * from t2 where b1; ----------------------------------------------------------------------------------------------------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | ----------------------------------------------------------------------------------------------------------- | 1 | SIMPLE | t2 | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | Using where | ----------------------------------------------------------------------------------------------------------- 1 row in set, 1 warning (0.00 sec)同理以下SQL也有类似现象 explain select * from t1 where b1 and c1;explain select * from t1 where c1;explain select * from t2 where b1 and c1;explain select * from t2 where c1;
http://www.hkea.cn/news/14279979/

相关文章:

  • 苏州市住房城乡建设局网站网站建设与管理的内容
  • 房产网站建设整体架构印江建设局网站
  • 做公司网站的必要性拖拉建网站
  • 单页网站cpa虚拟主机襄阳旅游景点网站建设
  • 怎么在word里做网站微信代运营加盟
  • 网站源码如何使用电子商务官方网站建设
  • 佛山新网站建设价格WordPress标签转拼音代码
  • 网站设计制作厂家有哪些广元市建设局官方网站
  • 诗敏家具网站是谁做的门户网站做的比较好的公司
  • 网站模版上线需要什么意思淘特网官方网站下载
  • 做营销策划的上哪个网站好wordpress跳转二级域名
  • 信创网站保定官网优化技巧
  • app模板下载网站上海网站建设yes404
  • 企业网站建设应用研究论文电商网站设计实例
  • 宣传 网站建设方案网络服务公司营业执照
  • 怎么看网站的ftp开发网站去哪里学
  • 做gif表情包的网站wordpress模板服务器
  • 新开传奇网站推荐深圳网络营销推广培训
  • 音乐制作人是干什么的哈尔滨优化网站排名
  • phpcms模板常州 网站优化
  • 北京手机版建站系统开发网站版面做的很好的公司
  • 建立一个网站多少钱手机微网站价
  • 下沙网站制作江门公司网站建设
  • 温州网站建设方案外包长沙seo制作
  • 关于网站建设的实训报告网站域名服务器查询
  • 罗湖网站建设设计怎么做游戏门户网站
  • 网站百度快照怎么做合肥市有做网站的公司吗
  • 怎么在阿里云建网站郴州专业的网站建设
  • 网站开发第三方公司网站制作的方法
  • 无锡大型设计网站报价国外修图教程网站