当前位置:   article > 正文

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

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

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> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

耗时(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> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

耗时(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 ~]# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

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> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

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: 1610

mysql> 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: 1540

mysql> 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: 1540

mysql> 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: 1540

mysql> 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: 1546

mysql> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

5、查看 表中的数据量

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

mysql> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

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> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

耗时(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> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

耗时(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> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

耗时(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> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

耗时(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> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

耗时(14.51 sec)

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号