-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
mo_sessions
table function and view (#11748)
讨论:https://github.com/matrixorigin/docs/blob/main/design/system_view.md#%E4%BC%9A%E8%AF%9D 1,增加table function `mo_sessions`. 2,增加系统视图`mo_catalog.mo_sessions`. 3,实现方案: 在table function `processlist`基础上,增加了字段`client_host`,`role`。并调整了部分字段的数据来源。 3,增加view的升级代码。 `mo_sessions`字段定义. ``` node_id: uuid。cn_id cn启动后,不会变 conn_id: client的tcp链接在mo中的编号。由hakeeper定义了编号的生成方式。 session_id: uuid。新session创建时产生 account: 租户名。 user: 用户名。 host: cn接受client请求的ip:port。 db: sql使用的database session_start: 新session创建时间戳。 command: mysql命令类型。COM_QUERY,COM_STMT_PREPARE,COM_STMT_EXECUTE等 info: 执行的sql。一个sql里面可能有多个语句 txn_id: sql涉及的事务id statement_id: sql中一个语句的uuid statement_type: sql中一个语句的类型。select,insert,update等 query_type: sql中一个语句的种类。 DQL,TCL等 sql_source_type: sql中一个语句的来源。external,internal等 query_start: sql中一个语句的开始执行时间。 client_host: client的ip端口。 role: 角色 ``` Approved by: @reusee, @m-schen, @nnsgmsone, @zhangxu19830126, @ouyuanning, @qingxinhome, @badboynt1, @aunjgr, @aressu1985
- Loading branch information
Showing
21 changed files
with
472 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.