集群层sql和下发到节点层的sql,如何对应?

warning: 这篇文章距离上次修改已过1648天,其中的内容可能已经有所变动。

下发到节点层的sql中的注释信息包含集群层sql的id信息。
例如:
在集群层执行select * from lineorder;,下发节点gc层show processlist信息如下,sql id是102。

[root@pst-red214 ~]# gccli
GBase client 8.6.1.1-16.28.81413. Copyright (c) 2004-2017, GBase.  All Rights Reserved.
gbase> show processlist;
+-----+-----------------+-----------------+------+---------+-------+-----------------------------+-------------------------+
| Id  | User            | Host            | db   | Command | Time  | State                       | Info                    |
+-----+-----------------+-----------------+------+---------+-------+-----------------------------+-------------------------+
|   1 | event_scheduler | localhost       | NULL | Daemon  | 15044 | Waiting for next activation | NULL                    |
|  52 | root            | 127.0.0.1:38654 | NULL | Sleep   |  3414 |                             | NULL                    |
| 101 | root            | 127.0.0.1:38820 | NULL | Query   |     0 | NULL                        | show processlist        |
| 102 | root            | 127.0.0.1:38822 | guo  | Query   |     3 | Sending task to gnodes      | select * from lineorder |
+-----+-----------------+-----------------+------+---------+-------+-----------------------------+-------------------------+
4 rows in set (Elapsed: 00:00:00.00)

gn层show processlist如下,下发的sql中SELECT /*192.168.105.214_102_1_2017-07-03_14:28:29*/ /*+ TID('6561') */,包含集群层sql的id 102。

[root@pst-red214 ~]# gncli
GBase client 8.6.1.1-16.28.81413. Copyright (c) 2004-2017, GBase.  All Rights Reserved.
gbase> show processlist;
+-----+-------+-----------------------+---------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
| Id  | User  | Host                  | db      | Command | Time | State        | Info                                                                                                 |
+-----+-------+-----------------------+---------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
| 539 | gbase | 192.168.105.212:10034 | gctmpdb | Sleep   | 9962 | NULL         | NULL                                                                                                 |
| 630 | root  | 127.0.0.1:61898       | NULL    | Query   |    0 | NULL         | show processlist                                                                                     |
| 631 | root  | 192.168.105.214:57013 | gctmpdb | Query   |    6 | Sending data | SELECT /*192.168.105.214_102_1_2017-07-03_14:28:29*/ /*+ TID('6561') */ `guo.lineorder`.`lo_orderkey |
+-----+-------+-----------------------+---------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
3 rows in set (Elapsed: 00:00:00.00)
最后修改于:2020年10月28日 16:39

添加新评论