Mysql索引:索引失效场景

索引失效

  • 索引列存在类型转换
  • 索引列使用了函数
  • 索引列参与了运算
  • 模糊查询最前面的为不确定匹配字符
  • 索引列使用IS NULL或者IS NOT NULL
  • 联合索引不满足最左匹配原则
  • 使用了select *
  • 使用OR条件,但不是所有的条件都有索引
  • 使用不等于(!= 或者 <>)操作符
  • 使用order by时
  • 列上的普通索引 not in和not exists

数据准备

CREATE TABLE `t_userinfo` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `id_no` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '身份编号',
  `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户名',
  `age` int(11) DEFAULT NULL COMMENT '年龄',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `union_idx` (`id_no`,`username`,`age`),
  KEY `create_time_idx` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;


INSERT INTO `t_userinfo` (`id`, `id_no`, `username`, `age`, `create_time`) VALUES (null, '1001', 'Tom1', 11, '2022-02-27 09:04:23');
INSERT INTO `t_userinfo` (`id`, `id_no`, `username`, `age`, `create_time`) VALUES (null, '1002', 'Tom2', 12, '2022-02-26 09:04:23');
INSERT INTO `t_userinfo` (`id`, `id_no`, `username`, `age`, `create_time`) VALUES (null, '1003', 'Tom3', 13, '2022-02-25 09:04:23');
INSERT INTO `t_userinfo` (`id`, `id_no`, `username`, `age`, `create_time`) VALUES (null, '1004', 'Tom4', 14, '2023-02-25 09:04:23');


-- 删除历史存储过程
DROP PROCEDURE IF EXISTS `insert_t_user`
 
-- 创建存储过程
delimiter $
 
CREATE PROCEDURE insert_t_user(IN limit_num int)
BEGIN
 DECLARE i INT DEFAULT 10;
    DECLARE id_no varchar(18) ;
    DECLARE username varchar(32) ;
    DECLARE age TINYINT DEFAULT 1;
    WHILE i < limit_num DO
        SET id_no = CONCAT("NO", i);
        SET username = CONCAT("Tom",i);
        SET age = FLOOR(10 + RAND()*2);
        INSERT INTO `t_userinfo` VALUES (NULL, id_no, username, age, NOW());
        SET i = i + 1;
    END WHILE;
 
END $
-- 调用存储过程
call insert_t_user(100);

索引失效场景

1、索引列存在类型转换

id_no 数据库的类型为varchar,但是查询添加的参数类型为整数。在查询过程中发生了隐式类型转换,导致索引失效。

mysql> explain select * from t_userinfo where id_no = 1002;
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | union_idx     | NULL | NULL    | NULL |   94 |    10.00 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 3 warnings (0.01 sec)

mysql>

这种情况还有一个特例,如果字段类型为int类型,而查询条件添加了单引号或双引号,则Mysql会参数转化为int类型,虽然使用了单引号或双引号。这种情况还是会走索引的。

mysql> explain select * from t_userinfo where id = '2';
+----+-------------+------------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
| id | select_type | table      | partitions | type  | possible_keys | key     | key_len | ref   | rows | filtered | Extra |
+----+-------------+------------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
|  1 | SIMPLE      | t_userinfo | NULL       | const | PRIMARY       | PRIMARY | 4       | const |    1 |   100.00 | NULL  |
+----+-------------+------------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
1 row in set, 1 warning (0.00 sec)

mysql>

2、索引列使用了函数

mysql> explain select * from t_userinfo where SUBSTR(id_no , 1, 3) = '100';
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | NULL          | NULL | NULL    | NULL |   94 |   100.00 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql>

类似的函数还有很多,如:concat等。

3、索引列参与了运算

# id列参与了计算
mysql> explain select * from t_userinfo where id + 1 = 2;
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | NULL          | NULL | NULL    | NULL |   94 |   100.00 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql>

# 在参数侧计算,id列没有参与计算
mysql> explain select * from t_userinfo where id = 2 - 1;
+----+-------------+------------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
| id | select_type | table      | partitions | type  | possible_keys | key     | key_len | ref   | rows | filtered | Extra |
+----+-------------+------------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
|  1 | SIMPLE      | t_userinfo | NULL       | const | PRIMARY       | PRIMARY | 4       | const |    1 |   100.00 | NULL  |
+----+-------------+------------+------------+-------+---------------+---------+---------+-------+------+----------+-------+
1 row in set, 1 warning (0.00 sec)

mysql>

4、模糊查询最前面的为不确定匹配字符

mysql> explain select * from t_userinfo where id_no like '%3';
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | NULL          | NULL | NULL    | NULL |   94 |    11.11 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql>

模糊匹配的占位符位于条件的首部 导致索引失效

5、索引列使用IS NULL或者IS NOT NULL

mysql> explain select * from t_userinfo where id_no is not null;
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | union_idx     | NULL | NULL    | NULL |   94 |   100.00 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql>

6、联合索引不满足最左匹配原则

使用到的联合索引KEY union_idx (id_no,username,age)

  • 最左边的字段为id_no,只要保证id_no出现在查询条件中,则会走该联合索引。
mysql> explain select * from t_userinfo where id_no = '1001';
+----+-------------+------------+------------+------+---------------+-----------+---------+-------+------+----------+-------+
| id | select_type | table      | partitions | type | possible_keys | key       | key_len | ref   | rows | filtered | Extra |
+----+-------------+------------+------------+------+---------------+-----------+---------+-------+------+----------+-------+
|  1 | SIMPLE      | t_userinfo | NULL       | ref  | union_idx     | union_idx | 75      | const |    1 |   100.00 | NULL  |
+----+-------------+------------+------------+------+---------------+-----------+---------+-------+------+----------+-------+
1 row in set, 1 warning (0.00 sec)

mysql>

mysql> explain select * from t_userinfo where id_no = '1001' and username = 'Tom1';
+----+-------------+------------+------------+------+---------------+-----------+---------+-------------+------+----------+-------+
| id | select_type | table      | partitions | type | possible_keys | key       | key_len | ref         | rows | filtered | Extra |
+----+-------------+------------+------------+------+---------------+-----------+---------+-------------+------+----------+-------+
|  1 | SIMPLE      | t_userinfo | NULL       | ref  | union_idx     | union_idx | 206     | const,const |    1 |   100.00 | NULL  |
+----+-------------+------------+------------+------+---------------+-----------+---------+-------------+------+----------+-------+
1 row in set, 1 warning (0.00 sec)

mysql> explain select * from t_userinfo where username = 'Tom1' and id_no = '1001';
+----+-------------+------------+------------+------+---------------+-----------+---------+-------------+------+----------+-------+
| id | select_type | table      | partitions | type | possible_keys | key       | key_len | ref         | rows | filtered | Extra |
+----+-------------+------------+------------+------+---------------+-----------+---------+-------------+------+----------+-------+
|  1 | SIMPLE      | t_userinfo | NULL       | ref  | union_idx     | union_idx | 206     | const,const |    1 |   100.00 | NULL  |
+----+-------------+------------+------------+------+---------------+-----------+---------+-------------+------+----------+-------+
1 row in set, 1 warning (0.00 sec)

mysql>
  • 不满足最左匹配原则,失效的情况
mysql> explain select * from t_userinfo where username = 'Tom1';
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | NULL          | NULL | NULL    | NULL |   94 |    10.00 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

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

mysql>

7、使用了select *

在上面的联合索引中,如果查询条件是age或username,当使用了select * ,肯定是不会走索引的

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


mysql>

# 查询列明确指定需要查询的列
mysql> explain select id,id_no,username,age from t_userinfo where age = 11;
+----+-------------+------------+------------+-------+---------------+-----------+---------+------+------+----------+--------------------------+
| id | select_type | table      | partitions | type  | possible_keys | key       | key_len | ref  | rows | filtered | Extra                    |
+----+-------------+------------+------------+-------+---------------+-----------+---------+------+------+----------+--------------------------+
|  1 | SIMPLE      | t_userinfo | NULL       | index | union_idx     | union_idx | 211     | NULL |   94 |    10.00 | Using where; Using index |
+----+-------------+------------+------------+-------+---------------+-----------+---------+------+------+----------+--------------------------+
1 row in set, 1 warning (0.00 sec)

mysql> explain select id,id_no,username,age from t_userinfo where username = 'Tom1';
+----+-------------+------------+------------+-------+---------------+-----------+---------+------+------+----------+--------------------------+
| id | select_type | table      | partitions | type  | possible_keys | key       | key_len | ref  | rows | filtered | Extra                    |
+----+-------------+------------+------------+-------+---------------+-----------+---------+------+------+----------+--------------------------+
|  1 | SIMPLE      | t_userinfo | NULL       | index | union_idx     | union_idx | 211     | NULL |   94 |    10.00 | Using where; Using index |
+----+-------------+------------+------------+-------+---------------+-----------+---------+------+------+----------+--------------------------+
1 row in set, 1 warning (0.00 sec)

mysql>

8、使用OR条件,但不是所有的条件都有索引

# 虽然id列有索引,但是username列不满足左匹配原则,使用条件OR,不满足所有添加都有索引
mysql> explain select * from t_userinfo where id = '2' or username = 'Tom1';
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | PRIMARY       | NULL | NULL    | NULL |   94 |    19.00 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

# 两个列都满足有索引,即使是使用条件OR,也会走索引
mysql> explain select * from t_userinfo where id = '2' or id_no = '1002';
+----+-------------+------------+------------+-------------+-------------------+-------------------+---------+------+------+----------+--------------------------------------------------+
| id | select_type | table      | partitions | type        | possible_keys     | key               | key_len | ref  | rows | filtered | Extra                                            |
+----+-------------+------------+------------+-------------+-------------------+-------------------+---------+------+------+----------+--------------------------------------------------+
|  1 | SIMPLE      | t_userinfo | NULL       | index_merge | PRIMARY,union_idx | union_idx,PRIMARY | 75,4    | NULL |    2 |   100.00 | Using sort_union(union_idx,PRIMARY); Using where |
+----+-------------+------------+------------+-------------+-------------------+-------------------+---------+------+------+----------+--------------------------------------------------+
1 row in set, 1 warning (0.01 sec)

mysql>

9、使用不等于(!= 或者 <>)操作符

当查询条件为字符串时,使用”<>“或”!=“作为条件查询,不走索引

mysql> explain select * from t_userinfo where id_no <> '1002';
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | union_idx     | NULL | NULL    | NULL |   94 |    98.94 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql>

但是如何字段类型为int的,还是可以走索引的。

mysql> explain select * from t_userinfo where id <> '1002';
+----+-------------+------------+------------+-------+---------------+---------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type  | possible_keys | key     | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+-------+---------------+---------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | range | PRIMARY       | PRIMARY | 4       | NULL |   95 |   100.00 | Using where |
+----+-------------+------------+------------+-------+---------------+---------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql>

10、使用order by时

mysql> explain select * from t_userinfo order by id_no asc;
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+----------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra          |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+----------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | NULL          | NULL | NULL    | NULL |   94 |   100.00 | Using filesort |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+----------------+
1 row in set, 1 warning (0.00 sec)

mysql>

11、列上的普通索引 not in和not exists

因为认为 not in 时结果集会比较大,而 in 的时候结果集会比较小。

但是not in 查询的是主键字段,还是会走索引的,普通索引就会失效。

mysql> explain select * from t_userinfo where id_no not in('1002');
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table      | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t_userinfo | NULL       | ALL  | union_idx     | NULL | NULL    | NULL |   94 |    98.94 | Using where |
+----+-------------+------------+------------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

mysql> explain select * from t_userinfo where id_no in('1002');
+----+-------------+------------+------------+------+---------------+-----------+---------+-------+------+----------+-------+
| id | select_type | table      | partitions | type | possible_keys | key       | key_len | ref   | rows | filtered | Extra |
+----+-------------+------------+------------+------+---------------+-----------+---------+-------+------+----------+-------+
|  1 | SIMPLE      | t_userinfo | NULL       | ref  | union_idx     | union_idx | 75      | const |    1 |   100.00 | NULL  |
+----+-------------+------------+------------+------+---------------+-----------+---------+-------+------+----------+-------+
1 row in set, 1 warning (0.00 sec)

mysql>

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【MySQL】

基础篇 执行一条 select 语句,期间发生了什么? 大家好,我是小林。 学习 SQL 的时候,大家肯定第一个先学到的就是 select 查询语句了,比如下面这句查询语句: // 在 product 表中,查询 id = 1 的记录 select * from product where id = 1;但是有没有想过,MySQL 执行一…

SARscape——均值滤波

目录 一、算法原理1、概述2、参考文献 二、软件操作三、结果展示1、原始图像2、滤波结果 一、算法原理 1、概述 均值滤波是选定一个合适的邻域窗口&#xff0c;然后取每个像素邻域窗口内的像素平均值&#xff0c;最后用均值取代待滤波的像素值作为最终的输出值。这种滤波比较简…

嵌入式linux系统中LCD屏驱动实现思路分析

在 Linux 下 LCD 的使用更加广泛,在搭配 QT 这样的 GUI 库下可以制作出非常精美的 UI 界面。接下来就来学习一下如何在 Linux 下驱动 LCD 屏幕。 第一:Framebuffer设备简介 先来回顾一下裸机的时候 LCD 驱动是怎么编写的,裸机 LCD 驱动编写流程如下: ①、初始化 I.MX6U 的…

【漏洞复现】Rejetto HTTP File Server 远程代码执行漏洞 (CVE-2024-23692)

免责声明&#xff1a; 本文内容旨在提供有关特定漏洞或安全漏洞的信息&#xff0c;以帮助用户更好地了解可能存在的风险。公布此类信息的目的在于促进网络安全意识和技术进步&#xff0c;并非出于任何恶意目的。阅读者应该明白&#xff0c;在利用本文提到的漏洞信息或进行相关测…

【windows|008】DNS服务详解

&#x1f341;博主简介&#xff1a; &#x1f3c5;云计算领域优质创作者 &#x1f3c5;2022年CSDN新星计划python赛道第一名 &#x1f3c5;2022年CSDN原力计划优质作者 ​ &#x1f3c5;阿里云ACE认证高级工程师 ​ &#x1f3c5;阿里云开发者社区专家博主 &#x1f48a;交流社…

FlowUs AI的使用教程和使用体验

FlowUs AI 使用教程 FlowUs AI特点使其成为提升个人和团队生产力的有力工具&#xff0c;无论是在学术研究、内容创作、技术开发还是日常办公中都能发挥重要作用。现在来看看如何使用FlowUs AI吧&#xff01; 注册与登录&#xff1a;首先&#xff0c;确保您已经注册并登录FlowU…

【图像识别系统】昆虫识别Python+卷积神经网络算法+人工智能+深度学习+机器学习+TensorFlow+ResNet50

一、介绍 昆虫识别系统&#xff0c;使用Python作为主要开发语言。通过TensorFlow搭建ResNet50卷积神经网络算法&#xff08;CNN&#xff09;模型。通过对10种常见的昆虫图片数据集&#xff08;‘蜜蜂’, ‘甲虫’, ‘蝴蝶’, ‘蝉’, ‘蜻蜓’, ‘蚱蜢’, ‘蛾’, ‘蝎子’, ‘…

HTML静态网页成品作业(HTML+CSS)——动漫猪猪侠网页(4个页面)

&#x1f389;不定期分享源码&#xff0c;关注不丢失哦 文章目录 一、作品介绍二、作品演示三、代码目录四、网站代码HTML部分代码 五、源码获取 一、作品介绍 &#x1f3f7;️本套采用HTMLCSS&#xff0c;未使用Javacsript代码&#xff0c;共有4个页面。 二、作品演示 三、代…

[MQTT]Mosquitto的權限管理_使用者/密碼(pwfile)和訪問控制清單(aclfile)

延續Mosquitto的內網連接(intranet)和使用者/密碼權限設置文章&#xff0c;經解讀mosquitto官網文檔&#xff0c;在權限管理部分&#xff0c;除了設置使用者/密碼(pwfile)之外&#xff0c;還有訪問控制清單(Access Control List, aclfile)可以設置。經過測試&#xff0c;同時設…

装备制造行业数据分析指标体系

数字化飞速发展的时代&#xff0c;多品种、定制化的产品需求、越来越短的产品生命周期、完善的售后服务、极佳的客户体验和快速的交货速度等&#xff0c;使得装备制造行业的经营环境越来越复杂&#xff0c;企业竞争从拼产品、拼价格迈向拼服务&#xff0c;装备制造企业正处于数…

sql server 非sa账号配置发布订阅

如果有些源端环境&#xff0c;sa账号被禁用&#xff0c;或者有其他问题&#xff0c;那可以按以下步骤操作。 使用高权限账户登录&#xff0c;另外需要拥有源端windows用户管理员的账号和密码 表发布订阅成功的前提&#xff1a;发布的表必须有主键。 创建一个专门用于发布订阅的…

66Uptime – 网站服务器 Cronjob 监控工具 v35.0.0扩展中文版安装

66Uptime是一款自托管、易于使用、轻量级且高性能的网站服务器和Cronjob监控工具。以其丰富的功能和便捷的管理方式&#xff0c;为用户提供了全方位的网站服务器和Cronjob监控解决方案&#xff1a; 主要功能&#xff1a; 监控网站服务器和Cronjob的运行状态&#xff0c;确保它们…

学习使用js和jquery修改css路径,实现html页面主题切换功能

学习使用js和jquery修改css路径&#xff0c;实现html页面主题切换功能 效果图html代码jquery切换css关键代码js切换css关键代码 效果图 html代码 <!DOCTYPE html> <html> <head><meta charset"utf-8"><title>修改css路径</title&g…

LabVIEW电机故障监测系统

电机作为工业生产中的关键设备&#xff0c;其故障会导致生产停滞和经济损失。因此&#xff0c;开发一个能实时监控电机状态并预测潜在故障的系统具有重要意义。通过高效的数据采集和分析技术&#xff0c;提升故障诊断的准确性和及时性。 系统组成 该系统由以下部分组成&#…

内外网映射访问内网服务器

如果本地有公网ip&#xff0c;比如连接的宽带有公网ip&#xff0c;可以直接通过路由配置转发就行了&#xff0c;如果本地没有公网ip&#xff0c;那就需要通过下面这种方式来访问内网服务器了。 1&#xff1a;首先内网服务器需要连接外网&#xff0c;可以通过网线或者WiFi都可以…

Google Earth Engine(GEE)——ui.DateSlider时间进度条的设置

结果 函数: ui.DateSlider(start, end, value, period, <

【递归、搜索与回溯】floodfill算法一

floodfill算法一 1.floodfill算法简介2.图像渲染3.岛屿数量4.岛屿的最大面积 点赞&#x1f44d;&#x1f44d;收藏&#x1f31f;&#x1f31f;关注&#x1f496;&#x1f496; 你的支持是对我最大的鼓励&#xff0c;我们一起努力吧!&#x1f603;&#x1f603; 1.floodfill算法…

测试:设计测试用例

文章目录 概念设计正交法判定表法 本篇总结的是测试用例的概念和设计方法 概念 测试用例是为了实施测试而向被测试的系统提供的一组集合&#xff0c;这个集合中包含的内容有测试环境&#xff0c;操作步骤&#xff0c;测试数据&#xff0c;预期结果等要素 在测试用例的设计中…

MySQL:JDBC详解!

文章目录 &#x1f4d1;JDBC简介&#x1f4d1;通过代码使用JDBC的API☁️结语 &#x1f4d1;JDBC简介 实际上在工作中&#xff0c;针对数据库的操作&#xff0c;很少会直接通过命令行/图形化客户端来操作数据库&#xff0c;更多的是通过代码&#xff08;C、Java、Python、GO……

基于simulink的PEM燃料电池控制系统建模与仿真,对比PID,积分分离以及滑模控制器

目录 1.课题概述 2.系统仿真结果 3.核心程序与模型 4.系统原理简介 4.1 PID控制器 4.2 积分分离PID控制器 4.3 滑模控制器 5.完整工程文件 1.课题概述 基于simulink的PEM燃料电池控制系统建模与仿真,对比PID,积分分离以及滑模控制器。 2.系统仿真结果 &#xff08;完…