GreatSQL社区

搜索

[已解决]

599 16 2023-12-28 17:28
本帖最后由 学无止境 于 2023-12-29 20:05 编辑

全部回复(16)
王权富贵 2023-12-28 18:10:40
对比一下执行计划 explain format=tree
KAiTO 2023-12-28 18:19:59
可以的话再提供下:
1、show processlist
2、show engine innodb status\G
学无止境 2023-12-28 21:17:05
王权富贵 发表于 2023-12-28 18:10
对比一下执行计划 explain format=tree

我在重新安装和导入数据,明天发你,我晚上测试一下;卸载greatsql,安装mysql8.0.34 ,同一台服务器,使用同样的数据,运行查询的结果在1秒多点;目前在重新安装greatsql和导入数据;
学无止境 2023-12-28 21:34:09
学无止境 发表于 2023-12-28 21:17
我在重新安装和导入数据,明天发你,我晚上测试一下;卸载greatsql,安装mysql8.0.34 ,同一台服务器,使 ...

greatsql执行:
-> Aggregate: count(0)  (cost=2588008.65 rows=1)
    -> Nested loop left join  (cost=2120734.35 rows=4672743)
        -> Index scan on a using index_companyID  (cost=485274.30 rows=4672743)
        -> Filter: (b.Sys_DeptLevel = 2)  (cost=0.25 rows=1)
            -> Single-row index lookup on b using PRIMARY (Sys_DeptID=a.Acc_CompanyID)  (cost=0.25 rows=1)
学无止境 2023-12-28 21:34:41
学无止境 发表于 2023-12-28 21:34
greatsql执行:
-> Aggregate: count(0)  (cost=2588008.65 rows=1)
    -> Nested loop left join  (cos ...

mysql8.034执行:
-> Aggregate: count(0)  (cost=2.39e+6 rows=1)
    -> Nested loop left join  (cost=1.96e+6 rows=4.31e+6)
        -> Index scan on a using index_companyID  (cost=450600 rows=4.31e+6)
        -> Filter: (b.Sys_DeptLevel = 2)  (cost=0.25 rows=1)
            -> Single-row index lookup on b using PRIMARY (Sys_DeptID=a.Acc_CompanyID)  (cost=0.25 rows=1)
学无止境 2023-12-28 21:50:55
KAiTO 发表于 2023-12-28 18:19
可以的话再提供下:
1、show processlist
2、show engine innodb status\G

show processlist:

| Id  | User            | Host                | db                 | Command | Time | State                  | Info                                                                                                 | Time_ms | Rows_sent | Rows_examined |
+-----+-----------------+---------------------+--------------------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+---------+-----------+---------------+
|   8 | event_scheduler | localhost           | NULL               | Daemon  | 2298 | Waiting on empty queue | NULL                                                                                                 | 2297217 |         0 |             0 |
| 292 | root            | 172.16.224.81:64748 | baiduzx_project    | Sleep   |  454 |                        | NULL                                                                                                 |  453909 |        17 |           264 |
| 355 | root            | 172.16.224.81:57173 | information_schema | Sleep   |  354 |                        | NULL                                                                                                 |  353411 |         0 |             0 |
| 383 | root            | localhost           | baiduzx_project    | Query   |    0 | init                   | show processlist                                                                                     |       0 |         0 |             0 |
| 392 | root            | localhost           | baiduzx_project    | Query   |    3 | executing              | SELECT COUNT(*) FROM(select  a.Acc_authorize ,a.Acc_SF_FirstName ,a.Acct_Cust_Name ,a.ID,a.Acc_ISTop |    2638 |         0 |             0 |
+-----+-----------------+---------------------+--------------------+---------+------+----
show engine innodb status\G:
I/O sum[96]:cur[0], unzip sum[0]:cur[0]
---BUFFER POOL 61
Buffer pool size   81915
Buffer pool size, bytes 1342095360
Free buffers       4000
Database pages     77915
Old database pages 28741
Modified db pages  0
Pending reads      0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 1210, not young 235385
0.00 youngs/s, 0.00 non-youngs/s
Pages read 300, created 111123, written 162805
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 77915, unzip_LRU len: 0
I/O sum[96]:cur[0], unzip sum[0]:cur[0]
---BUFFER POOL 62
Buffer pool size   81915
Buffer pool size, bytes 1342095360
Free buffers       4000
Database pages     77915
Old database pages 28741
Modified db pages  0
Pending reads      0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 930, not young 171179
0.00 youngs/s, 0.00 non-youngs/s
Pages read 131, created 104693, written 159256
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 77915, unzip_LRU len: 0
I/O sum[96]:cur[0], unzip sum[0]:cur[0]
---BUFFER POOL 63
Buffer pool size   81915
Buffer pool size, bytes 1342095360
Free buffers       4000
Database pages     77915
Old database pages 28741
Modified db pages  0
Pending reads      0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 1047, not young 180376
0.00 youngs/s, 0.00 non-youngs/s
Pages read 279, created 110115, written 164332
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 77915, unzip_LRU len: 0
I/O sum[96]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
yejr 2023-12-29 09:18:48
学无止境 发表于 2023-12-28 21:50
show processlist:

| Id  | User            | Host                | db                 | Command | ...

1、MySQL和GreatSQL除了PQ外,其他的配置选项都一样吗
2、这条SQL在MySQL和GreatSQL反复多次执行,都是1秒 vs 12秒的差距吗
3、GreatSQL选用的哪个版本
学无止境 2023-12-29 09:35:20
yejr 发表于 2023-12-29 09:18
1、MySQL和GreatSQL除了PQ外,其他的配置选项都一样吗
2、这条SQL在MySQL和GreatSQL反复多次执行,都是1秒 ...

1、配置基本上一样;
2、反复测试了10几次,都是一样;
3、GreatSQL用的是最新版本8.0.32-25
学无止境 2023-12-29 09:35:50
yejr 发表于 2023-12-29 09:18
1、MySQL和GreatSQL除了PQ外,其他的配置选项都一样吗
2、这条SQL在MySQL和GreatSQL反复多次执行,都是1秒 ...

1、配置基本上一样;
2、反复测试了10几次,都是一样;
3、GreatSQL用的是最新版本8.0.32-25
12下一页
学无止境

1

主题

0

博客

14

贡献

新手上路

Rank: 1

积分
24

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-5-8 00:39 , Processed in 0.019067 second(s), 17 queries , Redis On.
快速回复 返回顶部 返回列表