dws中pg_stat_activity在事务中query_id等字段变化情况
测试语句 |
sql |
场景1:begin;sql |
begin;SELECT CURRENT_TIME; select pg_sleep(5); select pg_sleep(5);SELECT CURRENT_TIME; |
场景2:start transaction;cursor |
start transaction;cursor c1 for select * from pg_class where pg_sleep(10) is null; fetch 3 in c1; |
场景3:start transaction;sql |
start transaction;SELECT CURRENT_TIME; select pg_sleep(5); select pg_sleep(5);SELECT CURRENT_TIME; |
检验语句:select pid,query_start,query_id,query from pg_stat_activity where state != 'idle';
测试版本:dws8.1.1
结论:pid在整个事务中无变化,query_start仅odbc场景3(start transaction;sql)变化。
query_id、query变化情况见下表:
测试场景 |
gsql |
|
odbc |
|
jdbc |
|
|
query_id |
query |
query_id |
query |
query_id |
query |
场景1:begin;sql |
变化 |
完整 |
变化 |
完整 |
变化 |
当前语句 |
场景2:start transaction;cursor |
不变 |
最后一句 |
不变 |
完整 |
不变 |
最后一句 |
场景3:start transaction;sql |
变化 |
完整 |
变化 |
完整 |
变化 |
当前语句 |
- 点赞
- 收藏
- 关注作者
评论(0)