MySQL进阶-索引-使用规则-最左前缀法则和范围查询

news2024/11/20 3:23:38

文章目录

  • 1、最左前缀法则
    • 2、启动mysql
    • 3、查询tb_user
    • 4、查看tb_user的索引
    • 5、执行计划 profession ='软件工程' and age=31 and status = '0'
    • 6、执行计划 profession ='软件工程' and age=31
    • 7、执行计划 profession ='软件工程'
    • 8、执行计划 age=31 and status = '0'
    • 9、执行计划 status = '0'
    • 10、执行计划 profession='软件工程' and status ='0'
    • 11、执行计划 age=31 and status='0' and profession='软件工程'
    • 12、执行计划 status='0' and profession='软件工程' and age=30
    • 13、执行计划 age=30 and profession='软件工程' and status='0'
    • 14、执行计划 profession='软件工程' and status='0' and age=30
  • 2、范围查询
    • 2.1、执行计划 profession='软件工程' and age>30 and status='0'
    • 2.2、执行计划 profession='软件工程' and age>=30 and status='0'

1、最左前缀法则

如果索引了多列(联合索引),要遵守最左前缀法则。最左前缀法则指的是查询从索引的最左列开始,并且不跳过索引中的列。
如果跳过某一列,索引将部分失效(后面的字段索引失效)。

2、启动mysql

C:\Users\dgq>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 299
Server version: 8.0.26 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

3、查询tb_user

mysql> use mybatis-example;
Database changed
mysql> select * from tb_user;
+----+--------+-------------+-----------------------+--------------------+------+--------+--------+---------------------+
| id | name   | phone       | email                 | profession         | age  | gender | status | createtime          |
+----+--------+-------------+-----------------------+--------------------+------+--------+--------+---------------------+
|  1 | 吕布   | 17799990000 | lvbu666@163.com       | 软件工程           |   23 | 1      | 6      | 2001-02-02 00:00:00 |
|  2 | 曹操   | 17799990001 | caocao666@qq.com      | 通讯工程           |   33 | 1      | 0      | 2001-03-05 00:00:00 |
|  3 | 赵云   | 17799990002 | 17799990@139.com      | 英语               |   34 | 1      | 2      | 2002-03-02 00:00:00 |
|  4 | 孙悟空 | 17799990003 | 17799990@sina.com     | 工程造价           |   54 | 1      | 0      | 2001-07-02 00:00:00 |
|  5 | 花木兰 | 17799990004 | 19980729@sina.com     | 软件工程           |   23 | 2      | 1      | 2001-04-22 00:00:00 |
|  6 | 大乔   | 17799990005 | daqiao666@sina.com    | 舞蹈               |   22 | 2      | 0      | 2001-02-07 00:00:00 |
|  7 | 露娜   | 17799990006 | luna_love@sina.com    | 应用数学           |   24 | 2      | 0      | 2001-02-08 00:00:00 |
|  8 | 程咬金 | 17799990007 | chengyaojin@163.com   | 化工               |   38 | 1      | 5      | 2001-05-23 00:00:00 |
|  9 | 项羽   | 17799990008 | xiaoyu666@qq.com      | 金属材料           |   43 | 1      | 0      | 2001-09-18 00:00:00 |
| 10 | 白起   | 17799990009 | baiqi666@sina.com     | 机械工程及其自动化 |   27 | 1      | 2      | 2001-08-16 00:00:00 |
| 11 | 韩信   | 17799990010 | hanxin520@163.com     | 无机非金属材料工程 |   27 | 1      | 0      | 2001-06-12 00:00:00 |
| 12 | 荆轲   | 17799990011 | jingke123@163.com     | 会计               |   29 | 1      | 0      | 2001-05-11 00:00:00 |
| 13 | 兰陵王 | 17799990012 | lanlinwang666@126.com | 工程造价           |   44 | 1      | 1      | 2001-04-09 00:00:00 |
| 14 | 狂铁   | 17799990013 | kuangtie@sina.com     | 应用数学           |   43 | 1      | 2      | 2001-04-10 00:00:00 |
| 15 | 貂蝉   | 17799990014 | 84958948374@qq.com    | 软件工程           |   40 | 2      | 3      | 2001-02-12 00:00:00 |
| 16 | 妲己   | 17799990015 | 2783238293@qq.com     | 软件工程           |   31 | 2      | 0      | 2001-01-30 00:00:00 |
| 17 | 芈月   | 17799990016 | xiaomin2001@sina.com  | 工业经济           |   35 | 2      | 0      | 2000-05-03 00:00:00 |
| 18 | 嬴政   | 17799990017 | 8839434342@qq.com     | 化工               |   38 | 1      | 1      | 2001-08-08 00:00:00 |
| 19 | 狄仁杰 | 17799990018 | jujiamlm8166@163.com  | 国际贸易           |   30 | 1      | 0      | 2007-03-12 00:00:00 |
| 20 | 安琪拉 | 17799990019 | jdodm1h@126.com       | 城市规划           |   51 | 2      | 0      | 2001-08-15 00:00:00 |
| 21 | 典韦   | 17799990020 | ycaunanjian@163.com   | 城市规划           |   52 | 1      | 2      | 2000-04-12 00:00:00 |
| 22 | 廉颇   | 17799990021 | lianpo321@126.com     | 土木工程           |   19 | 1      | 3      | 2002-07-18 00:00:00 |
| 23 | 后羿   | 17799990022 | altycj2000@139.com    | 城市园林           |   20 | 1      | 0      | 2002-03-10 00:00:00 |
| 24 | 姜子牙 | 17799990023 | 37483844@qq.com       | 工程造价           |   29 | 1      | 4      | 2003-05-26 00:00:00 |
+----+--------+-------------+-----------------------+--------------------+------+--------+--------+---------------------+
24 rows in set (0.00 sec)

mysql>

4、查看tb_user的索引

mysql> show index from tb_user;
+---------+------------+----------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| Table   | Non_unique | Key_name             | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression |
+---------+------------+----------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| tb_user |          0 | PRIMARY              |            1 | id          | A         |          24 |     NULL |   NULL |      | BTREE      |         |               | YES     | NULL       |
| tb_user |          0 | idx_user_phone       |            1 | phone       | A         |          24 |     NULL |   NULL |      | BTREE      |         |               | YES     | NULL       |
| tb_user |          1 | idx_user_name        |            1 | name        | A         |          24 |     NULL |   NULL |      | BTREE      |         |               | YES     | NULL       |
| tb_user |          1 | idx_user_pro_age_sta |            1 | profession  | A         |          16 |     NULL |   NULL | YES  | BTREE      |         |               | YES     | NULL       |
| tb_user |          1 | idx_user_pro_age_sta |            2 | age         | A         |          22 |     NULL |   NULL | YES  | BTREE      |         |               | YES     | NULL       |
| tb_user |          1 | idx_user_pro_age_sta |            3 | status      | A         |          24 |     NULL |   NULL | YES  | BTREE      |         |               | YES     | NULL       |
| tb_user |          1 | idx_email            |            1 | email       | A         |          24 |     NULL |   NULL | YES  | BTREE      |         |               | YES     | NULL       |
+---------+------------+----------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
7 rows in set (0.01 sec)

mysql>

5、执行计划 profession =‘软件工程’ and age=31 and status = ‘0’

mysql> select * from tb_user where profession ='软件工程' and age=31 and status = '0';
+----+------+-------------+-------------------+------------+------+--------+--------+---------------------+
| id | name | phone       | email             | profession | age  | gender | status | createtime          |
+----+------+-------------+-------------------+------------+------+--------+--------+---------------------+
| 16 | 妲己 | 17799990015 | 2783238293@qq.com | 软件工程   |   31 | 2      | 0      | 2001-01-30 00:00:00 |
+----+------+-------------+-------------------+------------+------+--------+--------+---------------------+
1 row in set (0.00 sec)

mysql> explain select * from tb_user where profession ='软件工程' and age=31 and status = '0';
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
| id | select_type | table   | partitions | type | possible_keys        | key                  | key_len | ref               | rows | filtered | Extra                 |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
|  1 | SIMPLE      | tb_user | NULL       | ref  | idx_user_pro_age_sta | idx_user_pro_age_sta | 54      | const,const,const |    1 |   100.00 | Using index condition |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
1 row in set, 1 warning (0.00 sec)

mysql>

profession的key_len=47
age的key_len=2
status的key_len=5
此时索引都生效

6、执行计划 profession =‘软件工程’ and age=31

mysql> explain select * from tb_user where profession ='软件工程' and age=31;
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------+------+----------+-------+
| id | select_type | table   | partitions | type | possible_keys        | key                  | key_len | ref         | rows | filtered | Extra |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------+------+----------+-------+
|  1 | SIMPLE      | tb_user | NULL       | ref  | idx_user_pro_age_sta | idx_user_pro_age_sta | 49      | const,const |    1 |   100.00 | NULL  |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------+------+----------+-------+
1 row in set, 1 warning (0.00 sec)

mysql>

profession的key_len=47
age的key_len=2
此时索引都生效

7、执行计划 profession =‘软件工程’

mysql> explain select * from tb_user where profession ='软件工程';
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------+------+----------+-------+
| id | select_type | table   | partitions | type | possible_keys        | key                  | key_len | ref   | rows | filtered | Extra |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------+------+----------+-------+
|  1 | SIMPLE      | tb_user | NULL       | ref  | idx_user_pro_age_sta | idx_user_pro_age_sta | 47      | const |    4 |   100.00 | NULL  |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------+------+----------+-------+
1 row in set, 1 warning (0.00 sec)

mysql>

profession的key_len=47
此时索引生效

8、执行计划 age=31 and status = ‘0’

mysql> explain select * from tb_user where age=31 and status = '0';
+----+-------------+---------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table   | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+---------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | tb_user | NULL       | ALL  | NULL          | NULL | NULL    | NULL |   24 |     4.17 | Using where |
+----+-------------+---------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql>

此时索引失效

9、执行计划 status = ‘0’

mysql> explain select * from tb_user where status = '0';
+----+-------------+---------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table   | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+---------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | tb_user | NULL       | ALL  | NULL          | NULL | NULL    | NULL |   24 |    10.00 | Using where |
+----+-------------+---------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql>

此时索引失效

10、执行计划 profession=‘软件工程’ and status =‘0’

mysql> explain select * from tb_user where profession='软件工程' and status ='0';
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------+------+----------+-----------------------+
| id | select_type | table   | partitions | type | possible_keys        | key                  | key_len | ref   | rows | filtered | Extra                 |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------+------+----------+-----------------------+
|  1 | SIMPLE      | tb_user | NULL       | ref  | idx_user_pro_age_sta | idx_user_pro_age_sta | 47      | const |    4 |    10.00 | Using index condition |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------+------+----------+-----------------------+
1 row in set, 1 warning (0.00 sec)

mysql>

profession的key_len=47
status索引失效

11、执行计划 age=31 and status=‘0’ and profession=‘软件工程’

mysql> explain select * from tb_user where age=31 and status='0' and profession='软件工程';
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
| id | select_type | table   | partitions | type | possible_keys        | key                  | key_len | ref               | rows | filtered | Extra                 |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
|  1 | SIMPLE      | tb_user | NULL       | ref  | idx_user_pro_age_sta | idx_user_pro_age_sta | 54      | const,const,const |    1 |   100.00 | Using index condition |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
1 row in set, 1 warning (0.00 sec)

mysql>

profession的key_len=47
age的key_len=2
status的key_len=5
此时索引都生效

12、执行计划 status=‘0’ and profession=‘软件工程’ and age=30

mysql> explain select * from tb_user where status='0' and profession='软件工程' and age=30;
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
| id | select_type | table   | partitions | type | possible_keys        | key                  | key_len | ref               | rows | filtered | Extra                 |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
|  1 | SIMPLE      | tb_user | NULL       | ref  | idx_user_pro_age_sta | idx_user_pro_age_sta | 54      | const,const,const |    1 |   100.00 | Using index condition |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
1 row in set, 1 warning (0.00 sec)

profession的key_len=47
age的key_len=2
status的key_len=5
此时索引都生效

13、执行计划 age=30 and profession=‘软件工程’ and status=‘0’

mysql> explain select * from tb_user where age=30 and profession='软件工程' and status='0';
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
| id | select_type | table   | partitions | type | possible_keys        | key                  | key_len | ref               | rows | filtered | Extra                 |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
|  1 | SIMPLE      | tb_user | NULL       | ref  | idx_user_pro_age_sta | idx_user_pro_age_sta | 54      | const,const,const |    1 |   100.00 | Using index condition |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
1 row in set, 1 warning (0.00 sec)

profession的key_len=47
age的key_len=2
status的key_len=5
此时索引都生效

14、执行计划 profession=‘软件工程’ and status=‘0’ and age=30

mysql> explain select * from tb_user where profession='软件工程' and status='0' and age=30;
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
| id | select_type | table   | partitions | type | possible_keys        | key                  | key_len | ref               | rows | filtered | Extra                 |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
|  1 | SIMPLE      | tb_user | NULL       | ref  | idx_user_pro_age_sta | idx_user_pro_age_sta | 54      | const,const,const |    1 |   100.00 | Using index condition |
+----+-------------+---------+------------+------+----------------------+----------------------+---------+-------------------+------+----------+-----------------------+
1 row in set, 1 warning (0.00 sec)

profession的key_len=47
age的key_len=2
status的key_len=5
此时索引都生效

2、范围查询

联合索引中,出现范围查询(>,<),范围查询右侧的列索引失效

2.1、执行计划 profession=‘软件工程’ and age>30 and status=‘0’

mysql> explain select * from tb_user where profession='软件工程' and age>30 and status='0';
+----+-------------+---------+------------+-------+----------------------+----------------------+---------+------+------+----------+-----------------------+
| id | select_type | table   | partitions | type  | possible_keys        | key                  | key_len | ref  | rows | filtered | Extra                 |
+----+-------------+---------+------------+-------+----------------------+----------------------+---------+------+------+----------+-----------------------+
|  1 | SIMPLE      | tb_user | NULL       | range | idx_user_pro_age_sta | idx_user_pro_age_sta | 49      | NULL |    2 |    10.00 | Using index condition |
+----+-------------+---------+------------+-------+----------------------+----------------------+---------+------+------+----------+-----------------------+
1 row in set, 1 warning (0.00 sec)

profession的key_len=47
age的key_len=2
此时status失效

2.2、执行计划 profession=‘软件工程’ and age>=30 and status=‘0’

mysql> explain select * from tb_user where profession='软件工程' and age>=30 and status='0';
+----+-------------+---------+------------+-------+----------------------+----------------------+---------+------+------+----------+-----------------------+
| id | select_type | table   | partitions | type  | possible_keys        | key                  | key_len | ref  | rows | filtered | Extra                 |
+----+-------------+---------+------------+-------+----------------------+----------------------+---------+------+------+----------+-----------------------+
|  1 | SIMPLE      | tb_user | NULL       | range | idx_user_pro_age_sta | idx_user_pro_age_sta | 54      | NULL |    2 |    10.00 | Using index condition |
+----+-------------+---------+------------+-------+----------------------+----------------------+---------+------+------+----------+-----------------------+
1 row in set, 1 warning (0.00 sec)

mysql>

profession的key_len=47
age的key_len=2
status的key_len=5
此时索引都生效

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1867033.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

从0-1搭建一个web项目vue3+vite+ts+element-plus(脚手架分析)

本章分析从0-1的搭建脚手架依赖 ObJack-Admin一款基于 Vue3.3、TypeScript、Vite3、Pinia、Element-Plus 开源的后台管理框架。在一定程度上节省您的开发效率。另外本项目还封装了一些常用组件、hooks、指令、动态路由、按钮级别权限控制等功能。感兴趣的小伙伴可以访问源码点个…

嵌入式调试接口

嵌入式系统的开发和调试是一项复杂的任务&#xff0c;需要强大的工具和接口来确保硬件和软件的正确性。在这个领域&#xff0c;JTAG&#xff08;Joint Test Action Group&#xff09;和SWD&#xff08;Serial Wire Debug&#xff09;是两个常用的调试接口标准&#xff0c;它们在…

使用 audit2allow 工具添加SELinux权限的方法

1. audit2allow工具的使用 audit2allow 命令的作用是分析日志&#xff0c;并提供允许的建议规则或拒绝的建议规则。 1.1 audit2allow的安装 sudo apt-get install policycoreutilssudo apt install policycoreutils-python-utils 1.2 auditallow的命令 命令含义用法-v--ve…

VSCode安装OpenImageDebugger

VSCode安装OpenImageDebugger 1. 官网2. 编译2.1 依赖项2.2 编译 OpenImageDebugger2.3 配置 GDB 和 LLDB 3. 验证安装是否成功 1. 官网 下载路径&#xff1a;OpenImageDebugger 2. 编译 2.1 依赖项 官网上描述&#xff0c; Qt 5.15.1Python 3.10.12 这两个其实配置并不需…

如何配置Redis + Rdis在IDEA中的使用

文章目录 Step1. 下载zipStep2. 修改环境变量Step3. 启动Redis服务端Step4. 启动Redis客户端Step5. IDEA中链接Redis Step1. 下载zip 下载 Redis-x64-xxx.zip压缩包&#xff0c;解压到 E 盘后&#xff0c;将文件夹重新命名为 redis 下载地址&#xff1a;Redis下载地址 Step2…

mongodb studio 3T 破解

官网下载后有30天的体验时间 一、破解原理是 30天后重置体验时间&#xff0c;所以每隔30天左右需要重新破解 1 新建studio.bat文件&#xff1a; echo offECHO 重置Studio 3T的使用日期......FOR /f "tokens1,2,* " %%i IN (reg query "HKEY_CURRENT_USER\Sof…

Java中特殊文件和日志技术

特殊文件和日志技术 特殊文件&#xff1a;Properties属性文件 特点&#xff1a; 特点一&#xff1a;都是键值对 特点二&#xff1a;键不能重复 特点三&#xff1a;文件后缀一般是Properties 作用&#xff1a; …

Python:基于TSFEL库对时间序列进行特征分析

1. TSFEL 时间序列作为主要TSFEL提取方法的输入传递&#xff0c;要么作为先前加载在内存中的数组传递&#xff0c;要么存储在数据集中的文件中。 由于TSFEL可以处理多维时间序列&#xff0c;因此随后应用了一套预处理方法&#xff0c;以确保信号质量足够和时间序列同步&#xf…

惊天大瓜姬圈天莱女明星出轨风波

#惊天大瓜&#xff01;姬圈天菜女明星出轨风波#近日&#xff0c;娱乐圈掀起了一场前所未有的风暴&#xff01;狗仔队放出重磅消息&#xff0c;直指某位姬圈天菜级别的女明星深陷出轨泥潭。消息一出&#xff0c;引发了网友们的热议和猜测&#xff0c;究竟这位神秘的女明星是谁&a…

VPS环境搭建及配置

VPS简介 VPS&#xff08;Virtual Private Server&#xff09;是一种虚拟化技术&#xff0c;可以将一台物理服务器分成多个虚拟服务器&#xff0c;每个虚拟服务器都有独立的操作系统和资源&#xff0c;相互之间互不影响。VPS可以提供类似于独立服务器的功能&#xff0c;但价格更…

Nuxt3 的生命周期和钩子函数(二)

title: Nuxt3 的生命周期和钩子函数&#xff08;二&#xff09; date: 2024/6/26 updated: 2024/6/26 author: cmdragon excerpt: 摘要&#xff1a;本文深入介绍了Nuxt.js框架中几个关键的生命周期钩子函数&#xff0c;包括app:redirected&#xff08;SSR环境下重定向前触发…

关于Vite+Vue+Ts WebStorm路径别名的问题

一、准备一个项目 二、在 vite.config.js 中添加 resolve: {alias: {: /src}} 三、tsconfig.app.json中添加代码 //添加代码"baseUrl": ".","paths": {"/*": ["src/*"]}把src的一个文件修改路径为开头 四、安装插件 npm i …

从音频中提取MFCC特征的过程

在语音信号处理和语音识别领域&#xff0c;梅尔频率倒谱系数&#xff08;MFCC&#xff09;是最常用的特征之一。本文将逐步介绍如何从音频中提取MFCC特征&#xff0c;并在每个步骤中进行可视化展示。 步骤 1&#xff1a;加载音频文件并查看波形 首先&#xff0c;我们需要加载…

安装与配置:MySQL的环境搭建之旅(二)

目录 引言&#xff1a;从理论到实践的跨越 一、安装MySQL&#xff1a;跨平台的便捷指南 Windows环境 Linux环境 macOS环境 二、基本配置&#xff1a;端口设置与字符集选择 三、从零到一的蜕变 引言&#xff1a;从理论到实践的跨越 在前一章节《MySQL简介》中&#xff0c…

力扣随机一题 6/26 哈希表 数组 思维

博客主页&#xff1a;誓则盟约系列专栏&#xff1a;IT竞赛 专栏关注博主&#xff0c;后期持续更新系列文章如果有错误感谢请大家批评指出&#xff0c;及时修改感谢大家点赞&#x1f44d;收藏⭐评论✍ 题目一&#xff1a; 2869.收集元素的最少操作次数【简单】 题目&#xff…

Flutter实现页面间传参

带参跳转 步骤 在router中配置这个路由需要携带的参数,这里的参数是 arguments,注意要用花括号包裹参数名称 在相应组件中实现带参构造函数 在state类中可以直接使用${widget.arguments}来访问到传递的参数 在其他页面中使用Navigator.pushNamed()带参跳转

【课程总结】Day11(中):手势图像识别实战(Vgg16和ResNet)

前言 在上一章《【课程总结】Day11&#xff08;上&#xff09;&#xff1a;手势图像识别实战(LeNet模型)》课程中&#xff0c;我们通过使用LeNet模型实现了手势识别。在本章内容中&#xff0c;我们将搭建Vgg模型和ResNet模型&#xff0c;并应用到手势识别中。 Vgg模型 Vgg简…

黑马点评06短信登录-用户请求和会话管理过程

用户请求发送&#xff1a; 用户的浏览器向服务器发送请求&#xff08;例如&#xff0c;访问网页或提交表单&#xff09;。请求头包含之前存储在浏览器中的Cookie&#xff0c;其中包括会话ID&#xff08;Session ID&#xff09;。 服务器接收请求&#xff1a; 服务器接收到用户的…

智慧城市:数据可视化如何提升城市管理

数据可视化在智慧城市中有何应用&#xff1f;随着城市化进程的加快和信息技术的飞速发展&#xff0c;智慧城市的建设成为全球各大城市追求的目标。而数据可视化技术作为智慧城市的重要组成部分&#xff0c;通过将复杂的数据转化为直观、易理解的图表和图形&#xff0c;极大地提…

c#关键字 ArgumentOutOfRangeException .? IEnumerable string.Join

c# ArgumentOutOfRangeException ArgumentOutOfRangeException 是 C# 中表示某个参数值超出了方法或属性定义的有效范围时引发的一个异常。这个异常通常在尝试访问数组、集合、字符串等的无效索引&#xff0c;或者当传递给方法或属性的参数不在其有效范围内时发生。 例如&…