MySQL高级-SQL优化- limit优化(覆盖索引加子查询)

文章目录

  • 0、limit 优化
    • 0.1、从表 tb_sku 中按照 id 列进行排序,然后跳过前 9000000 条记录
    • 0.2、通过子查询获取按照 id 排序后的第 9000000 条开始的 10 条记录的 id 值,然后在原表中根据这些 id 值获取对应的完整记录
  • 1、上传5个sql文件到 /root
  • 2、查看文件是否上传成功
  • 3、创建表 tb_sku 结构
  • 4、执行load指令将准备好的数据,加载到表结构中
  • 5、查看 表中的数据量
  • 6、查询分页前10条记录
  • 7、使用分页查询 limit 10,10
  • 8、分页查询 从第100万开始查询10条
  • 9、分页查询 从第500万开始查询10条
  • 10、分页查询 从第900万开始查询10条

0、limit 优化

一个常见又非常头疼的问题就是 limit 2000000,10。此时需要MySQL排序前2000010记录,仅仅返回2000000-2000010的记录,其他记录丢弃,查询排序的代价非常大。
优化思路:一般分页查询时,通过创建 覆盖索引 能够比较好地提高性能,可以通过 覆盖索引 加子查询形式进行优化。

0.1、从表 tb_sku 中按照 id 列进行排序,然后跳过前 9000000 条记录

mysql> select id from tb_sku order by id limit 9000000,10;
+---------+
| id      |
+---------+
| 9000001 |
| 9000002 |
| 9000003 |
| 9000004 |
| 9000005 |
| 9000006 |
| 9000007 |
| 9000008 |
| 9000009 |
| 9000010 |
+---------+
10 rows in set (9.03 sec)mysql> 

耗时(9.03 sec)
这种查询方式可能会非常慢,因为它需要读取并丢弃前 9,000,000 条记录才能到达你想要的起始位置

0.2、通过子查询获取按照 id 排序后的第 9000000 条开始的 10 条记录的 id 值,然后在原表中根据这些 id 值获取对应的完整记录

mysql> select s.* from tb_sku s,(select id from tb_sku order by id limit 9000000,10) a where s.id=a.id;
+---------+-----------------------+-------------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
| id      | sn                    | name              | price | num   | alert_num | image                                                                                                                      | images                                                                                                                     | weight | create_time         | update_time         | category_name | brand_name | spec          | sale_num | comment_num | status |
+---------+-----------------------+-------------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
| 9000001 | 100000003145009000001 | 华为Meta9000001   | 87901 |  9961 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t5590/64/5811657380/234462/5398e856/5965e173N34179777.jpg!q70.jpg.webp      | https://m.360buyimg.com/mobilecms/s720x720_jfs/t5590/64/5811657380/234462/5398e856/5965e173N34179777.jpg!q70.jpg.webp      |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 真皮包        | viney      | 白色9000001   |       39 |           0 | 1      |
| 9000002 | 100000003145009000002 | 华为Meta9000002   |     3 |  9946 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23998/350/2363990466/222391/a6e9581d/5b7cba5bN0c18fb4f.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23998/350/2363990466/222391/a6e9581d/5b7cba5bN0c18fb4f.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉拉裤        | 巴布豆     | 白色9000002   |       54 |           0 | 1      |
| 9000003 | 100000003145009000003 | 华为Meta9000003   | 78903 |  9993 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉杆箱        | 莎米特     | 白色9000003   |        7 |           0 | 1      |
| 9000004 | 100000003145009000004 | 华为Meta9000004   | 26604 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉杆箱        | 莎米特     | 白色9000004   |        0 |           0 | 1      |
| 9000005 | 100000003145009000005 | 华为Meta9000005   | 40805 |  9996 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | 华为       | 白色9000005   |        4 |           0 | 1      |
| 9000006 | 100000003145009000006 | 华为Meta9000006   | 89206 |  9930 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | 华为       | 白色9000006   |       70 |           0 | 1      |
| 9000007 | 100000003145009000007 | 华为Meta9000007   | 11707 |     4 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t20707/78/2349564629/130172/50a245d8/5b8e00e2Nf0bcd624.jpg!q70.jpg.webp     | https://m.360buyimg.com/mobilecms/s720x720_jfs/t20707/78/2349564629/130172/50a245d8/5b8e00e2Nf0bcd624.jpg!q70.jpg.webp     |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | vivo       | 白色9000007   |        1 |           0 | 1      |
| 9000008 | 100000003145009000008 | 华为Meta9000008   | 99808 |  9994 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色9000008   |        6 |           0 | 1      |
| 9000009 | 100000003145009000009 | 华为Meta9000009   | 41709 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色9000009   |        0 |           0 | 1      |
| 9000010 | 100000003145009000010 | 华为Meta9000010   | 23710 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色9000010   |        0 |           0 | 1      |
+---------+-----------------------+-------------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
10 rows in set (9.44 sec)mysql> 

耗时(9.44 sec)

1、上传5个sql文件到 /root

在这里插入图片描述

注意 : 由于1000w的数据量较大 , 如果直接加载1000w , 会非常耗费CPU及内存 ; 已经拆分为5个部分 , 每一个部分为200w数据 , load 5次即可 ;

2、查看文件是否上传成功

[root@localhost ~]# ll
总用量 3653220
-rw-------. 1 root root      1533 124 2023 anaconda-ks.cfg
-rw-r--r--. 1 root root       191 625 13:29 dump6379.rdb
-rw-r--r--. 1 root root       191 625 13:31 dump6380.rdb
-rw-r--r--. 1 root root       191 625 13:32 dump6381.rdb
-rw-r--r--. 1 root root       583 624 11:13 dump.rdb
-rw-r--r--. 1 root root      1564 124 2023 initial-setup-ks.cfg
-rw-r--r--. 1 root root  57650380 222 2022 load_user_100w_sort.sql
drwxr-xr-x. 3 root root        18 18 18:11 minio
-rw-r--r--. 1 root root       141 625 17:00 nodes-6379.conf
-rw-------. 1 root root    178567 63 13:50 nohup.out
-rw-r--r--. 1 root root 733017638 222 2022 tb_sku1.sql
-rw-r--r--. 1 root root 737475921 628 19:39 tb_sku2.sql
-rw-r--r--. 1 root root 737504035 222 2022 tb_sku3.sql
-rw-r--r--. 1 root root 737525348 628 19:40 tb_sku4.sql
-rw-r--r--. 1 root root 737508325 222 2022 tb_sku5.sql
drwxr-xr-x. 2 root root         6 124 2023 公共
drwxr-xr-x. 2 root root         6 124 2023 模板
drwxr-xr-x. 2 root root         6 124 2023 视频
drwxr-xr-x. 2 root root         6 124 2023 图片
drwxr-xr-x. 2 root root         6 124 2023 文档
drwxr-xr-x. 2 root root         6 124 2023 下载
drwxr-xr-x. 2 root root         6 124 2023 音乐
drwxr-xr-x. 2 root root         6 124 2023 桌面
[root@localhost ~]# 

3、创建表 tb_sku 结构

mysql> CREATE TABLE `tb_sku` (->   `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '商品id',->   `sn` varchar(100) NOT NULL COMMENT '商品条码',->   `name` varchar(200) NOT NULL COMMENT 'SKU名称',->   `price` int(20) NOT NULL COMMENT '价格(分)',->   `num` int(10) NOT NULL COMMENT '库存数量',->   `alert_num` int(11) DEFAULT NULL COMMENT '库存预警数量',->   `image` varchar(200) DEFAULT NULL COMMENT '商品图片',->   `images` varchar(2000) DEFAULT NULL COMMENT '商品图片列表',->   `weight` int(11) DEFAULT NULL COMMENT '重量(克)',->   `create_time` datetime DEFAULT NULL COMMENT '创建时间',->   `update_time` datetime DEFAULT NULL COMMENT '更新时间',->   `category_name` varchar(200) DEFAULT NULL COMMENT '类目名称',->   `brand_name` varchar(100) DEFAULT NULL COMMENT '品牌名称',->   `spec` varchar(200) DEFAULT NULL COMMENT '规格',->   `sale_num` int(11) DEFAULT '0' COMMENT '销量',->   `comment_num` int(11) DEFAULT '0' COMMENT '评论数',->   `status` char(1) DEFAULT '1' COMMENT '商品状态 1-正常,2-下架,3-删除',->   PRIMARY KEY (`id`) USING BTREE-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品表';
Query OK, 0 rows affected, 7 warnings (0.32 sec)mysql> show tables;
+-------------------+
| Tables_in_atguigu |
+-------------------+
| tb_sku            |
| tb_user           |
+-------------------+
2 rows in set (0.00 sec)mysql> 

4、执行load指令将准备好的数据,加载到表结构中

mysql> load data local infile '/root/tb_sku1.sql' into table `tb_sku` fields terminated by ',' lines terminated by '\n';
Query OK, 2000000 rows affected, 1610 warnings (46.10 sec)
Records: 2000000  Deleted: 0  Skipped: 0  Warnings: 1610mysql> load data local infile '/root/tb_sku2.sql' into table `tb_sku` fields terminated by ',' lines terminated by '\n';
Query OK, 2000000 rows affected, 1540 warnings (42.06 sec)
Records: 2000000  Deleted: 0  Skipped: 0  Warnings: 1540mysql> load data local infile '/root/tb_sku3.sql' into table `tb_sku` fields terminated by ',' lines terminated by '\n';
Query OK, 2000000 rows affected, 1540 warnings (46.09 sec)
Records: 2000000  Deleted: 0  Skipped: 0  Warnings: 1540mysql> load data local infile '/root/tb_sku4.sql' into table `tb_sku` fields terminated by ',' lines terminated by '\n';
Query OK, 2000000 rows affected, 1540 warnings (41.28 sec)
Records: 2000000  Deleted: 0  Skipped: 0  Warnings: 1540mysql> load data local infile '/root/tb_sku5.sql' into table `tb_sku` fields terminated by ',' lines terminated by '\n';
Query OK, 2000000 rows affected, 1546 warnings (41.12 sec)
Records: 2000000  Deleted: 0  Skipped: 0  Warnings: 1546mysql> 

5、查看 表中的数据量

mysql> select count(*) from tb_sku;
+----------+
| count(*) |
+----------+
| 10000000 |
+----------+
1 row in set (12.80 sec)mysql> 

6、查询分页前10条记录

mysql> select * from tb_sku limit 0,10;
+----+------------------+--------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+----------+----------+-------------+--------+
| id | sn               | name         | price | num   | alert_num | image                                                                                                                      | images                                                                                                                     | weight | create_time         | update_time         | category_name | brand_name | spec     | sale_num | comment_num | status |
+----+------------------+--------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+----------+----------+-------------+--------+
|  1 | 100000003145001  | 华为Meta1    | 87901 |  9961 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t5590/64/5811657380/234462/5398e856/5965e173N34179777.jpg!q70.jpg.webp      | https://m.360buyimg.com/mobilecms/s720x720_jfs/t5590/64/5811657380/234462/5398e856/5965e173N34179777.jpg!q70.jpg.webp      |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 真皮包        | viney      | 白色1    |       39 |           0 | 1      |
|  2 | 100000003145002  | 华为Meta2    |     3 |  9946 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23998/350/2363990466/222391/a6e9581d/5b7cba5bN0c18fb4f.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23998/350/2363990466/222391/a6e9581d/5b7cba5bN0c18fb4f.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉拉裤        | 巴布豆     | 白色2    |       54 |           0 | 1      |
|  3 | 100000003145003  | 华为Meta3    | 78903 |  9993 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉杆箱        | 莎米特     | 白色3    |        7 |           0 | 1      |
|  4 | 100000003145004  | 华为Meta4    | 26604 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉杆箱        | 莎米特     | 白色4    |        0 |           0 | 1      |
|  5 | 100000003145005  | 华为Meta5    | 40805 |  9996 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | 华为       | 白色5    |        4 |           0 | 1      |
|  6 | 100000003145006  | 华为Meta6    | 89206 |  9930 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | 华为       | 白色6    |       70 |           0 | 1      |
|  7 | 100000003145007  | 华为Meta7    | 11707 |     4 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t20707/78/2349564629/130172/50a245d8/5b8e00e2Nf0bcd624.jpg!q70.jpg.webp     | https://m.360buyimg.com/mobilecms/s720x720_jfs/t20707/78/2349564629/130172/50a245d8/5b8e00e2Nf0bcd624.jpg!q70.jpg.webp     |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | vivo       | 白色7    |        1 |           0 | 1      |
|  8 | 100000003145008  | 华为Meta8    | 99808 |  9994 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色8    |        6 |           0 | 1      |
|  9 | 100000003145009  | 华为Meta9    | 41709 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色9    |        0 |           0 | 1      |
| 10 | 1000000031450010 | 华为Meta10   | 23710 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色10   |        0 |           0 | 1      |
+----+------------------+--------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+----------+----------+-------------+--------+
10 rows in set (0.01 sec)mysql> 

耗时(0.01 sec)

7、使用分页查询 limit 10,10

mysql> select * from tb_sku limit 10,10;
+----+------------------+--------------+-------+-------+-----------+--------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+-------------------------+----------+----------+-------------+--------+
| id | sn               | name         | price | num   | alert_num | image                                                                                                                    | images                                                                                                                   | weight | create_time         | update_time         | category_name | brand_name              | spec     | sale_num | comment_num | status |
+----+------------------+--------------+-------+-------+-----------+--------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+-------------------------+----------+----------+-------------+--------+
| 11 | 1000000031450011 | 华为Meta11   | 86111 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp     | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp     |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红                  | 白色11   |        0 |           0 | 1      |
| 12 | 1000000031450012 | 华为Meta12   | 11312 |  9999 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25867/102/1274759920/233086/96f7fc46/5b909851N02396afd.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25867/102/1274759920/233086/96f7fc46/5b909851N02396afd.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色12   |        1 |           0 | 1      |
| 13 | 1000000031450013 | 华为Meta13   | 99013 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25867/102/1274759920/233086/96f7fc46/5b909851N02396afd.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25867/102/1274759920/233086/96f7fc46/5b909851N02396afd.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色13   |        0 |           0 | 1      |
| 14 | 1000000031450014 | 华为Meta14   | 75314 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/4364/38/240/219619/5b909979E13d29469/7c908af4d61cf659.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/4364/38/240/219619/5b909979E13d29469/7c908af4d61cf659.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色14   |        0 |           0 | 1      |
| 15 | 1000000031450015 | 华为Meta15   | 69915 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25867/102/1274759920/233086/96f7fc46/5b909851N02396afd.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25867/102/1274759920/233086/96f7fc46/5b909851N02396afd.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色15   |        0 |           0 | 1      |
| 16 | 1000000031450016 | 华为Meta16   |  5916 |  9997 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25867/102/1274759920/233086/96f7fc46/5b909851N02396afd.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25867/102/1274759920/233086/96f7fc46/5b909851N02396afd.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色16   |        3 |           0 | 1      |
| 17 | 1000000031450017 | 华为Meta17   | 30517 |  9960 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25957/363/1290162041/159777/41fe0e72/5b908f41N4884b765.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25957/363/1290162041/159777/41fe0e72/5b908f41N4884b765.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色17   |       40 |           0 | 1      |
| 18 | 1000000031450018 | 华为Meta18   | 63818 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/4364/38/240/219619/5b909979E13d29469/7c908af4d61cf659.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/4364/38/240/219619/5b909979E13d29469/7c908af4d61cf659.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色18   |        0 |           0 | 1      |
| 19 | 1000000031450019 | 华为Meta19   |    20 |  9995 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25957/363/1290162041/159777/41fe0e72/5b908f41N4884b765.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t25957/363/1290162041/159777/41fe0e72/5b908f41N4884b765.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色19   |        5 |           0 | 1      |
| 20 | 1000000031450020 | 华为Meta20   | 94020 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/3876/25/222/165387/5b908202E95fa6558/6b8fd41266c11cd5.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/3876/25/222/165387/5b908202E95fa6558/6b8fd41266c11cd5.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | ARNO FOCUS ON YOUR EYES | 白色20   |        0 |           0 | 1      |
+----+------------------+--------------+-------+-------+-----------+--------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+-------------------------+----------+----------+-------------+--------+
10 rows in set (0.00 sec)mysql> 

耗时(0.00 sec)

8、分页查询 从第100万开始查询10条

mysql> select * from tb_sku limit 1000000,10;
+---------+-----------------------+-------------------+--------+-------+-----------+-------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
| id      | sn                    | name              | price  | num   | alert_num | image                                                                                                                   | images                                                                                                                  | weight | create_time         | update_time         | category_name | brand_name | spec          | sale_num | comment_num | status |
+---------+-----------------------+-------------------+--------+-------+-----------+-------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
| 1000001 | 100000003145001000001 | 华为Meta1000001   |  92001 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t18196/293/2136823958/421330/7e75be4b/5ae83333Nae68e60d.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t18196/293/2136823958/421330/7e75be4b/5ae83333Nae68e60d.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 又一春     | 白色1000001   |        0 |           0 | 1      |
| 1000002 | 100000003145001000002 | 华为Meta1000002   |  52002 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t18196/293/2136823958/421330/7e75be4b/5ae83333Nae68e60d.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t18196/293/2136823958/421330/7e75be4b/5ae83333Nae68e60d.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 又一春     | 白色1000002   |        0 |           0 | 1      |
| 1000003 | 100000003145001000003 | 华为Meta1000003   |  70003 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t18196/293/2136823958/421330/7e75be4b/5ae83333Nae68e60d.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t18196/293/2136823958/421330/7e75be4b/5ae83333Nae68e60d.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 又一春     | 白色1000003   |        0 |           0 | 1      |
| 1000004 | 100000003145001000004 | 华为Meta1000004   |  93904 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 回力       | 白色1000004   |        0 |           0 | 1      |
| 1000005 | 100000003145001000005 | 华为Meta1000005   |  34805 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 回力       | 白色1000005   |        0 |           0 | 1      |
| 1000006 | 100000003145001000006 | 华为Meta1000006   |  57606 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 回力       | 白色1000006   |        0 |           0 | 1      |
| 1000007 | 100000003145001000007 | 华为Meta1000007   |  76307 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 回力       | 白色1000007   |        0 |           0 | 1      |
| 1000008 | 100000003145001000008 | 华为Meta1000008   | 101008 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 回力       | 白色1000008   |        0 |           0 | 1      |
| 1000009 | 100000003145001000009 | 华为Meta1000009   |  16609 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 回力       | 白色1000009   |        0 |           0 | 1      |
| 1000010 | 100000003145001000010 | 华为Meta1000010   |  20610 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  | https://m.360buyimg.com/mobilecms/s720x720_jfs/t6547/152/1052579367/121386/23997aff/5949c409N0240aa60.jpg!q70.jpg.webp  |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 回力       | 白色1000010   |        0 |           0 | 1      |
+---------+-----------------------+-------------------+--------+-------+-----------+-------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
10 rows in set (2.01 sec)mysql> 

耗时(2.01 sec)

9、分页查询 从第500万开始查询10条

mysql> select * from tb_sku limit 5000000,10;
+---------+-----------------------+-------------------+--------+-------+-----------+------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
| id      | sn                    | name              | price  | num   | alert_num | image                                                                                                                  | images                                                                                                                 | weight | create_time         | update_time         | category_name | brand_name | spec          | sale_num | comment_num | status |
+---------+-----------------------+-------------------+--------+-------+-----------+------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
| 5000001 | 100000003145005000001 | 华为Meta5000001   |  83301 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000001   |        0 |           0 | 1      |
| 5000002 | 100000003145005000002 | 华为Meta5000002   | 127202 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000002   |        0 |           0 | 1      |
| 5000003 | 100000003145005000003 | 华为Meta5000003   | 145403 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000003   |        0 |           0 | 1      |
| 5000004 | 100000003145005000004 | 华为Meta5000004   | 127004 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000004   |        0 |           0 | 1      |
| 5000005 | 100000003145005000005 | 华为Meta5000005   |  95805 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000005   |        0 |           0 | 1      |
| 5000006 | 100000003145005000006 | 华为Meta5000006   | 105306 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000006   |        0 |           0 | 1      |
| 5000007 | 100000003145005000007 | 华为Meta5000007   |  81707 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000007   |        0 |           0 | 1      |
| 5000008 | 100000003145005000008 | 华为Meta5000008   | 140008 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000008   |        0 |           0 | 1      |
| 5000009 | 100000003145005000009 | 华为Meta5000009   | 134109 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23416/164/1114672941/97718/7a52de73/5b51a552Na67d01ef.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000009   |        0 |           0 | 1      |
| 5000010 | 100000003145005000010 | 华为Meta5000010   |  98210 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22147/88/2343365802/108958/ebe4bd23/5b51adb8N9bcfa164.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22147/88/2343365802/108958/ebe4bd23/5b51adb8N9bcfa164.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 休闲鞋        | 森马       | 白色5000010   |        0 |           0 | 1      |
+---------+-----------------------+-------------------+--------+-------+-----------+------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
10 rows in set (7.68 sec)mysql> 

耗时(7.68 sec)

10、分页查询 从第900万开始查询10条

mysql> select * from tb_sku limit 9000000,10;
+---------+-----------------------+-------------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
| id      | sn                    | name              | price | num   | alert_num | image                                                                                                                      | images                                                                                                                     | weight | create_time         | update_time         | category_name | brand_name | spec          | sale_num | comment_num | status |
+---------+-----------------------+-------------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
| 9000001 | 100000003145009000001 | 华为Meta9000001   | 87901 |  9961 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t5590/64/5811657380/234462/5398e856/5965e173N34179777.jpg!q70.jpg.webp      | https://m.360buyimg.com/mobilecms/s720x720_jfs/t5590/64/5811657380/234462/5398e856/5965e173N34179777.jpg!q70.jpg.webp      |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 真皮包        | viney      | 白色9000001   |       39 |           0 | 1      |
| 9000002 | 100000003145009000002 | 华为Meta9000002   |     3 |  9946 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23998/350/2363990466/222391/a6e9581d/5b7cba5bN0c18fb4f.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t23998/350/2363990466/222391/a6e9581d/5b7cba5bN0c18fb4f.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉拉裤        | 巴布豆     | 白色9000002   |       54 |           0 | 1      |
| 9000003 | 100000003145009000003 | 华为Meta9000003   | 78903 |  9993 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉杆箱        | 莎米特     | 白色9000003   |        7 |           0 | 1      |
| 9000004 | 100000003145009000004 | 华为Meta9000004   | 26604 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp | https://m.360buyimg.com/mobilecms/s720x720_jfs/t1/25363/12/2929/274060/5c21df3aE1789bda7/030af31afd116ae0.jpg!q70.jpg.webp |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 拉杆箱        | 莎米特     | 白色9000004   |        0 |           0 | 1      |
| 9000005 | 100000003145009000005 | 华为Meta9000005   | 40805 |  9996 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | 华为       | 白色9000005   |        4 |           0 | 1      |
| 9000006 | 100000003145009000006 | 华为Meta9000006   | 89206 |  9930 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    | https://m.360buyimg.com/mobilecms/s720x720_jfs/t22642/312/2563982615/103706/1398b13d/5b865bb3N0409f0d0.jpg!q70.jpg.webp    |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | 华为       | 白色9000006   |       70 |           0 | 1      |
| 9000007 | 100000003145009000007 | 华为Meta9000007   | 11707 |     4 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t20707/78/2349564629/130172/50a245d8/5b8e00e2Nf0bcd624.jpg!q70.jpg.webp     | https://m.360buyimg.com/mobilecms/s720x720_jfs/t20707/78/2349564629/130172/50a245d8/5b8e00e2Nf0bcd624.jpg!q70.jpg.webp     |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 手机          | vivo       | 白色9000007   |        1 |           0 | 1      |
| 9000008 | 100000003145009000008 | 华为Meta9000008   | 99808 |  9994 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色9000008   |        6 |           0 | 1      |
| 9000009 | 100000003145009000009 | 华为Meta9000009   | 41709 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色9000009   |        0 |           0 | 1      |
| 9000010 | 100000003145009000010 | 华为Meta9000010   | 23710 | 10000 |       100 | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       | https://m.360buyimg.com/mobilecms/s720x720_jfs/t26281/196/340140952/94362/c353173/5b8f6e63N56334c08.jpg!q70.jpg.webp       |     10 | 2019-05-01 00:00:00 | 2019-05-01 00:00:00 | 老花镜        | 夕阳红     | 白色9000010   |        0 |           0 | 1      |
+---------+-----------------------+-------------------+-------+-------+-----------+----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+--------+---------------------+---------------------+---------------+------------+---------------+----------+-------------+--------+
10 rows in set (14.51 sec)mysql> 

耗时(14.51 sec)

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

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

相关文章

libctk shared library的设计及编码实践记录

一、引言 1.1 <libctk>的由来 1.2 <libctk>的设计理论依据 1.3 <libctk>的设计理念 二、<libctk>的依赖库 三、<libctk>的目录说明 四、<libctk>的功能模块及使用实例说明 4.1 日志模块 4.2 mysql client模块 4.3 ftp client模块 4…

鸿蒙开发设备管理:【@ohos.geolocation (位置服务)】

位置服务 说明&#xff1a; 本模块首批接口从API version 7开始支持。后续版本的新增接口&#xff0c;采用上角标单独标记接口的起始版本。 导入模块 import geolocation from ohos.geolocation;geolocation.on(‘locationChange’) on(type: ‘locationChange’, request: L…

安卓开发自定义时间日期显示组件

安卓开发自定义时间日期显示组件 问题背景 实现时间和日期显示&#xff0c;左对齐和对齐两种效果&#xff0c;如下图所示&#xff1a; 问题分析 自定义view实现一般思路&#xff1a; &#xff08;1&#xff09;自定义一个View &#xff08;2&#xff09;编写values/attrs.…

poi-tl 生成 word 文件(插入文字、图片、表格、图表)

文章说明 本篇文章主要通过代码案例的方式&#xff0c;展示 poi-tl 生成 docx 文件的一些常用操作&#xff0c;主要涵盖以下内容 &#xff1a; 插入文本字符&#xff08;含样式、超链接&#xff09;插入图片插入表格引入标签&#xff08;通过可选文字的方式&#xff0c;这种方…

大模型和数据库最新结合进展

写在前面 本文主要内容是上次接受 infoQ 访谈&#xff0c;百度智能云朱洁老师介绍了大模型和 AI 结合相关话题&#xff0c;这次整体再刷新下&#xff0c;给到对这个领域感兴趣的同学。 当前&#xff0c;百度智能云云数据库特惠专场开始&#xff01;热销规格新用户免费使用&am…

最逼真的简易交通灯设计

最逼真的简易交通灯设计 需要资料的请在文章末尾获取&#xff08;有问题可以私信我哦~~&#xff09; 01 资料内容 Proteus仿真文件程序源码实物制作&#xff0c;代码修改&#xff0c;功能定制&#xff08;需额外收费&#xff0c;价格实惠&#xff0c;欢迎咨询&#xff09; …

实验场:在几分钟内使用 Elasticsearch 进行 RAG 应用程序实验

作者&#xff1a;来自 Elastic Joe McElroy, Serena Chou 什么是 Playground&#xff08;实验场&#xff09;&#xff1f; 我们很高兴发布我们的 Playground 体验 —- 一个低代码界面&#xff0c;开发人员可以在几分钟内使用自己的私人数据探索他们选择的 LLM。 在对对话式搜…

41割队伍

上海市计算机学会竞赛平台 | YACSYACS 是由上海市计算机学会于2019年发起的活动,旨在激发青少年对学习人工智能与算法设计的热情与兴趣,提升青少年科学素养,引导青少年投身创新发现和科研实践活动。https://www.iai.sh.cn/problem/387 题目描述 给定 𝑛n 个数字 𝑎1,�…

Hi3861 OpenHarmony嵌入式应用入门--LiteOS Semaphore做同步使用

信号量作为同步使用 创建一个Semaphore对象&#xff0c;并指定一个初始的计数值&#xff08;通常称为“许可”或“令牌”的数量&#xff09;。这个计数值表示当前可用的资源数量或可以同时访问共享资源的线程数。当一个线程需要访问共享资源时&#xff0c;它会尝试从Semaphore…

加油站可视化:打造智能化运营与管理新模式

智慧加油站可视化通过图扑 HT 构建仿真的三维模型&#xff0c;将加油站的布局、设备状态、人员活动等信息动态呈现。管理者可以通过直观的可视化界面实时监控和分析运营状况&#xff0c;快速做出决策&#xff0c;提高管理效率和安全水平&#xff0c;推动加油站向智能化管理转型…

后端之路第三站(Mybatis)——结合案例讲Mybatis怎么操作sql

先讲一下准备工作整体流程要做什么 我们要基于一个员工管理系统作为案例&#xff0c;进行员工信息的【增、删、改、查】 原理就是用Mybatis通过java语言来执行sql语句&#xff0c;来达到【增、删、改、查】 一、准备工作 1、引入数据库数据 首先我们把一个员工、部门表的数…

【51单片机入门】速通定时器

文章目录 前言定时器是什么初始化定时器初始化的大概步骤TMOD寄存器C/T寄存器 触发定时器中断是什么中断函数定时器点亮led 总结 前言 在嵌入式系统的开发中&#xff0c;定时器是一个非常重要的组成部分。它们可以用于产生精确的时间延迟&#xff0c;或者在特定的时间间隔内触…

Java--常用类APl(复习总结)

前言: Java是一种强大而灵活的编程语言&#xff0c;具有广泛的应用范围&#xff0c;从桌面应用程序到企业级应用程序都能够使用Java进行开发。在Java的编程过程中&#xff0c;使用标准类库是非常重要的&#xff0c;因为标准类库提供了丰富的类和API&#xff0c;可以简化开发过…

【接口自动化测试】第三节.实现项目核心业务接口自动化

文章目录 前言一、实现登录接口对象封装和调用 1.0 登录接口的接口测试文档 1.1 接口对象层&#xff08;封装&#xff09; 1.2 测试脚本层&#xff08;调用&#xff09;二、课程新增接口对象封装和调用 2.0 课程新增接口的接口测试文档 2.1 接口对象层…

AVL树模拟

1.概念 虽然二叉搜索树可以缩短查找的效率&#xff0c;但如果数据有序或者接近有序时二叉搜索树树将退化为单支树&#xff0c;查找元素相当于在顺序表中搜索元素&#xff0c;效率低下。AVL 树是具有一下性质的二叉搜索树&#xff1a; 1.它的左右子树都是AVL树 2.左右子…

Mac 如何安装 wget

1.安装 Homebrew2.安装 wget3.检测 wget 是否安装成功 1.安装 Homebrew 在安装 wget 之前需要安装一个适用于 mac 的包管理器 Homebrew&#xff0c;打开 mac 终端执行如下命令进行安装&#xff1a; /usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/h…

新手第一个漏洞复现:MS17-010(永恒之蓝)

文章目录 漏洞原理漏洞影响范围复现环境复现步骤 漏洞原理 漏洞出现在Windows SMB v1中的内核态函数srv!SrvOs2FeaListToNt在处理FEA&#xff08;File Extended Attributes&#xff09;转换时。该函数在将FEA list转换成NTFEA&#xff08;Windows NT FEA&#xff09;list前&am…

【Golang - 90天从新手到大师】Day14 - 方法和接口

一&#xff0e; go方法 go方法&#xff1a;在函数的func和函数名间增加一个特殊的接收器类型&#xff0c;接收器可以是结构体类型或非结构体类型。接收器可以在方法内部访问。创建一个接收器类型为Type的methodName方法。 func (t Type) methodName(parameter list) {}go引入…

解决“Duplicate keys detected: ‘ ‘.This may cause an update error.”问题

问题原因 出现“Duplicate keys detected”的错误&#xff0c;通常表示在v-for指令中使的:key绑定值有重复。 如果前端是静态数据&#xff0c;一般能自我避免:key绑定值有重复。如果前端是绑定的动态数据&#xff0c;那么需要另外提供一个唯一的键。 在这个例子中&#xff0c…

【LeetCode】接雨水

目录 一、题目二、解法完整代码 一、题目 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图&#xff0c;计算按此排列的柱子&#xff0c;下雨之后能接多少雨水。 示例 1&#xff1a; 输入&#xff1a;height [0,1,0,2,1,0,1,3,2,1,2,1] 输出&#xff1a;6 解释&#xff…