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

电子商务网站的后台管理系统wordpress滑动登录

电子商务网站的后台管理系统,wordpress滑动登录,商城网站模板html,PHP 网站搜索怎么做目录 1、背景2、环境3、访问类型【1】const【2】ref【3】ref_or_null【4】range【5】index【6】all 4、总结 1、背景 mysql通过查询条件查询到结果的过程就叫访问方法#xff0c;一条查询语句的访问方法有很多种#xff0c;接下来我们就来讲一下各种访问方法。 2、环境 创… 目录 1、背景2、环境3、访问类型【1】const【2】ref【3】ref_or_null【4】range【5】index【6】all 4、总结 1、背景 mysql通过查询条件查询到结果的过程就叫访问方法一条查询语句的访问方法有很多种接下来我们就来讲一下各种访问方法。 2、环境 创建表 mysql CREATE TABLE test2- (- id INT AUTO_INCREMENT PRIMARY KEY,- str1 VARCHAR(255),- str2 VARCHAR(255),- str3 CHAR(5),- str4 VARCHAR(255),- str5 CHAR(10),- INDEX idx_str1 (str1),- UNIQUE INDEX idx_str3 (str3),- INDEX idx_str4_str5 (str4, str5)- ) ENGINE InnoDB DEFAULT CHARSET utf8; Query OK, 0 rows affected, 1 warning (0.03 sec)插入100条数据 mysql INSERT INTO test2 (str1, str2, str3, str4, str5) VALUES- (value1, data1, abc, value4_1, value5_1),- (value2, data2, def, value4_2, value5_2),- ...- (value99, data99, yz91, value4_99, value5_99),- (value100, data100, yz92, value4_100, value5_100); Query OK, 100 rows affected (0.02 sec) Records: 100 Duplicates: 0 Warnings: 03、访问类型 【1】const 通过主键索引或者唯一索引查询一条记录的方法就为const可以通过explain关键字来看查询语句的访问方式通过主键查询示例 mysql explain select * from test2 where id 3; ---------------------------------------------------------------------------------------------------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | ---------------------------------------------------------------------------------------------------------- | 1 | SIMPLE | test2 | NULL | const | PRIMARY | PRIMARY | 4 | const | 1 | 100.00 | NULL | ---------------------------------------------------------------------------------------------------------- 1 row in set, 1 warning (0.00 sec)type字段就是访问方式我们再看看通过唯一索引查询的示例 mysql explain select * from test2 where str3 abc; ----------------------------------------------------------------------------------------------------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | ----------------------------------------------------------------------------------------------------------- | 1 | SIMPLE | test2 | NULL | const | idx_str3 | idx_str3 | 16 | const | 1 | 100.00 | NULL | ----------------------------------------------------------------------------------------------------------- 1 row in set, 1 warning (0.00 sec)【2】ref 使用普通二级索引进行等值匹配时访问类型就为ref示例如下 mysql explain select * from test2 where str1 value7; ---------------------------------------------------------------------------------------------------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | ---------------------------------------------------------------------------------------------------------- | 1 | SIMPLE | test2 | NULL | ref | idx_str1 | idx_str1 | 767 | const | 1 | 100.00 | NULL | ---------------------------------------------------------------------------------------------------------- 1 row in set, 1 warning (0.01 sec)【3】ref_or_null 二级索引进行等值匹配时又想把值为NULL的查询出来这种查询类型就为ref_or_null先把上面插入的数据部分记录的str1字段改为NULLsql如下 mysql update test2 set str1 NULL where id in (3, 6, 8, 9, 34, 78, 89); Query OK, 7 rows affected (0.01 sec) Rows matched: 7 Changed: 7 Warnings: 0再看查询类型 mysql explain select * from test2 where str1 value7 or str1 null; ------------------------------------------------------------------------------------------------------------------ --------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra| ------------------------------------------------------------------------------------------------------------------ --------------- | 1 | SIMPLE | test2 | NULL | ref_or_null | idx_str1 | idx_str1 | 768 | const | 2 | 100.00 | Using i ndex condition | ------------------------------------------------------------------------------------------------------------------ --------------- 1 row in set, 1 warning (0.00 sec)【4】range 顾名思义范围查询就是range示例如下 mysql explain select * from test2 where id 2 and id 7; --------------------------------------------------------------------------------------------------------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | --------------------------------------------------------------------------------------------------------------- | 1 | SIMPLE | test2 | NULL | range | PRIMARY | PRIMARY | 4 | NULL | 4 | 100.00 | Using where | --------------------------------------------------------------------------------------------------------------- 1 row in set, 1 warning (0.00 sec)【5】index 使用组合索引中非最左边作为查询条件时并且查询的字段不需要回表这个时候就会将组合索引叶子节点全部扫描一遍这种查询方式就叫index示例如下 mysql explain select str4, str5 from test2 where str5 value5_15; ------------------------------------------------------------------------------------------------------------------ ---------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra| ------------------------------------------------------------------------------------------------------------------ ---------------- | 1 | SIMPLE | test2 | NULL | index | idx_str4_str5 | idx_str4_str5 | 799 | NULL | 100 | 10.00 | Using whe re; Using index | ------------------------------------------------------------------------------------------------------------------ ---------------- 1 row in set, 1 warning (0.00 sec)【6】all 对主键索引所在的叶子节点进行全表扫描就叫all示例如下 mysql explain select * from test2; ----------------------------------------------------------------------------------------------------- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | ----------------------------------------------------------------------------------------------------- | 1 | SIMPLE | test2 | NULL | ALL | NULL | NULL | NULL | NULL | 100 | 100.00 | NULL | ----------------------------------------------------------------------------------------------------- 1 row in set, 1 warning (0.00 sec)4、总结 mysql中优化器会将我们的查询条件进行优化我们可以通过explain关键字来查看单表查询的访问方式。
http://www.hkea.cn/news/14429647/

相关文章:

  • 网站的维护工作内容一元购网站怎么做
  • 做qq头像的网站销售公司简介模板
  • 内蒙古建设安全监督网站不记得在哪里做的网站备案
  • 国外网站导航电子商务视觉设计
  • 网站建设中iis新乡电子商务网站建设
  • 网站建设初验申请表软件开发合同范本免费
  • 菜鸟网站编程微信彩票网站网站建设
  • 长春网站建设于健wordpress建立目录权限
  • 济南智能网站建设报价做网站 广告费 步骤
  • seo网站外链平台应用市场app下载安装到手机
  • 设计高端网站哪家好国家企业信用信息系统(河南)
  • qq可以做公司免费网站大连建设网官网网上办公大厅
  • 广东省建设教育协会网站个人旅游网站建设方案
  • 网站建设公司dz000婚庆网站设计说明书
  • 网站怎么设置为可信任网站齐全的赣州网站建设
  • 徐汇制作网站哪家好263企业邮箱登陆入囗
  • 昆明网站推广8888168想学营销策划去哪里学
  • 网站建设包括哪些项目息壤空间怎么上传网站
  • 网站被降权表现徐州网站排名
  • 杂志社网站建设意义免费的网站服务器
  • 网站职能好三网网站
  • 做油和米的网站百度竞价推广账户
  • 建站工具有哪些社区凉山州规划和建设局网站
  • 湘西建设监理协会网站彩票网站做任务拿佣金
  • 长治一般建一个网站需要多少钱云南网站建设哪个好
  • 网站和做游戏设计网站大全免费
  • 网页设计网站页面搜索的代码制作网页小图片
  • 无锡网站 appseo面试常见问题及答案
  • 公司网站asp源码网站开发中使用框架吗
  • 网站建设流量入口网监备案网站更换域名