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

wordpress短代码参数seo1新地址在哪里

wordpress短代码参数,seo1新地址在哪里,浏览器为什么无法打开网页,北京有哪些网站建设在MySQL中,即使表中没有数据,查询优化器也会考虑使用索引来执行查询。但在某些情况下,查询优化器可能会选择不使用索引,这通常是基于成本效益分析的结果。 表中没有任何数据时,无论是否使用索引,查询结果都…

在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 id=1;
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+--------------------------------+
| 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 id=1;
+----+-------------+-------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
| 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 b=1;
+----+-------------+-------+------------+-------+---------------+---------+---------+------+------+----------+--------------------------+
| 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 b=1;
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------------+
| 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 b=1 and c=1;
> explain select * from t1 where c=1;
> 
> explain select * from t2 where b=1 and c=1;
> explain select * from t2 where c=1;
http://www.shuangfujiaoyu.com/news/8727.html

相关文章:

  • 做自媒体与做网站品牌推广策略怎么写
  • 中国网站的特点鹤壁seo
  • 哪个网站做贺卡做的好外贸找客户有什么网站
  • 电子商务网站建设方案seo优化裤子关键词
  • 黄页88网注册seo的方法
  • 做网站需要哪些证书个人博客网站模板
  • 网站建设制作包括哪些方面sem竞价托管价格
  • 淄博网站制作设计高端网页自动点击软件
  • 如何让域名指向网站app推广方式
  • 怎么制作网站教程步骤视频seo网络优化平台
  • 赵增敏. JSP网站开发详解哪些网站是营销型网站
  • 找程序员做网站青海网站seo
  • 长春做网站建设的公司阿里云域名注册入口官网
  • 成都青羊网站建设郑州网络营销公司哪个好
  • 什么网站做的很好怎么做一个小程序
  • flash做网站的流程优化模型的推广
  • 泉州wap网站制作手机网站优化排名
  • 江西做网站找谁北京seo优化多少钱
  • 做红k线网站网页制作流程
  • 联通做网站白帽seo公司
  • 公司简介模板文字版seo是搜索引擎营销
  • 怎么做网站企业文化栏目电商运营主要工作内容
  • 网站建设销售技巧话术qq推广软件
  • 汕头网站制作公司上海关键词自动排名
  • 利于seo优化的网站站长之家
  • 云南做网站多少钱女排联赛排名
  • 广州网站建设信科公司最新seo黑帽技术工具软件
  • 网站开发课程设计报告互联网营销的方法有哪些
  • 网站定制化服务淮北seo
  • 买域名去哪个网站网络推广平台哪家公司最好