首页 > 数据库 > 国内数据库 > GBase 8a临时数据目录tmpdata作用和说明
在GBase 8a数据库集群中,如果数据运算过程中,内存不足以保存所有数据时,会使用磁盘保存临时中间结果。本文介绍该临时数据目录tmpdata的作用和说明。
本文使用的版本是9.5.2.36。
gbase> select version(); +-----------------+ | version() | +-----------------+ | 9.5.2.36.125743 | +-----------------+ 1 row in set (Elapsed: 00:00:00.00)
安装目录下/gcluster/tmpdata
安装目录下/gnode/tmpdata
[root@gbase_rh7_001 tmpdata]# ll * cache_gcluster: total 0 drwx------ 2 gbase gbase 6 Jan 25 16:44 HashJoin drwx------ 2 gbase gbase 6 Jan 25 16:44 tmp_longblob drwx------ 3 gbase gbase 22 Jan 25 16:44 tmp_materialized drwx------ 2 gbase gbase 6 Jan 25 16:44 TrashCan krb5cc_gcluster: total 4 -rw------- 1 gbase gbase 4 Jan 25 16:44 primary [root@gbase_rh7_001 tmpdata]# [root@gbase_rh7_001 tmpdata]# [root@gbase_rh7_001 tmpdata]# [root@gbase_rh7_001 tmpdata]# ll total 0 drwx------. 6 gbase gbase 82 Jan 25 16:44 cache_gcluster drwx------. 2 gbase gbase 21 Jan 25 16:44 krb5cc_gcluster
Kerberos的认证文件,属于配置参数的默认位置。可修改。
gbase> show variables like '%krb%'; +---------------------+---------------------------------------------+ | Variable_name | Value | +---------------------+---------------------------------------------+ | gbase_krb5cc_tmpdir | /opt/gbase/gcluster/tmpdata/krb5cc_gcluster | +---------------------+---------------------------------------------+ 1 row in set (Elapsed: 00:00:00.01)
[gbase@gbase_rh7_001 tmpdata]$ ll total 0 drwx------. 6 gbase gbase 82 Jan 27 09:22 cache_gbase drwx------. 2 gbase gbase 21 Jan 25 16:44 krb5cc_gbase [gbase@gbase_rh7_001 tmpdata]$ ll * cache_gbase: total 0 drwx------ 2 gbase gbase 6 Jan 25 16:44 HashJoin drwx------ 2 gbase gbase 6 Jan 25 16:44 tmp_longblob drwx------ 3 gbase gbase 22 Jan 25 16:44 tmp_materialized drwx------ 2 gbase gbase 6 Jan 27 09:22 TrashCan krb5cc_gbase: total 4 -rw------- 1 gbase gbase 4 Jan 25 16:44 primary [gbase@gbase_rh7_001 tmpdata]$
临时数据缓冲目录,用于保存计算的中间结果。
排序产生的临时文件
用于Hash切分时临时文件,比如group,join,distinct等。
HashJoin
One pass Hash Join 的中间临时文件。
blob字段数据超过32K时,临时保存目录。
物化表目录
物化表的元数据目录。
可清理的垃圾文件。
Kerberos的认证文件,属于配置参数的默认位置。可修改。
gbase> show variables like '%krb%'; +---------------------+---------------------------------------+ | Variable_name | Value | +---------------------+---------------------------------------+ | gbase_krb5cc_tmpdir | /opt/gbase/gnode/tmpdata/krb5cc_gbase | +---------------------+---------------------------------------+ 1 row in set (Elapsed: 00:00:00.01)
join后包括行号等的中间结果集物化文件。其中s0000000346对应session id,也就是show processlist里面的连接ID。
s0000000346_GB_MAT0000007E8554A0xbe87080.express_tmp
对应gncli里的ID列。如下第一行ID=346的是一个select join的语句,产生了中间结果集,写到了tmpdata目录下。
[gbase@gbase_rh7_001 cache_gbase]$ gncli -e"show processlist"
+-----+------+------------------+---------+---------+------+-------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+------------------+---------+---------+------+-------+------------------------------------------------------------------------------------------------------+
| 346 | root | 10.0.2.101:41714 | gctmpdb | Query | 107 | init | SELECT /*10.0.2.101_104_163_2021-01-27_08:47:07*/ /*+ TID('366758') */ `vc01.pm.t1`.`id` AS `c2`, ca |
| 353 | root | 10.0.2.101:41912 | NULL | Sleep | 667 | NULL | NULL |
| 360 | root | 10.0.2.101:42252 | gctmpdb | Sleep | 288 | NULL | NULL |
| 372 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+-----+------+------------------+---------+---------+------+-------+------------------------------------------------------------------------------------------------------+
[gbase@gbase_rh7_001 cache_gbase]$
对应trc跟踪日志里面的MAT部分。如下例子写了1.6G的MAT文件。
2021-01-27 10:48:25.981 [M: 6M, 0B,D: 0B] [DC: 79, 0] SUMMARY 2021-01-27 10:48:25.981 [M: 6M, 0B,D: 0B] [DC: 79, 0] elapsed time: 00:02:14.024 2021-01-27 10:48:25.981 [M: 6M, 0B,D: 0B] [DC: 79, 0] data loaded from storage: 0B, 0s, 0 DC. 2021-01-27 10:48:25.981 [M: 6M, 0B,D: 0B] [DC: 79, 0] data decompressed: 0B, 0s. 2021-01-27 10:48:25.982 [M: 6M, 0B,D: 0B] [DC: 79, 0] temp space IO stats: 2021-01-27 10:48:25.982 [M: 6M, 0B,D: 0B] [DC: 79, 0] CB write( 0B, 0time, 0sec), read( 0B, 0time, 0sec) 2021-01-27 10:48:25.982 [M: 6M, 0B,D: 0B] [DC: 79, 0] SRT write( 0B, 0time, 0sec), read( 0B, 0time, 0sec) 2021-01-27 10:48:25.982 [M: 6M, 0B,D: 0B] [DC: 79, 0] GDC write( 0B, 0time, 0sec), read( 0B, 0time, 0sec) 2021-01-27 10:48:25.982 [M: 6M, 0B,D: 0B] [DC: 79, 0] MAT write(1.60G, 114time, 2sec), read(3.00G, 197148time, 1sec) 2021-01-27 10:48:25.982 [M: 6M, 0B,D: 0B] [DC: 79, 0] HSJ write( 0B, 0time, 0sec), read( 0B, 0time, 0sec) 2021-01-27 10:48:25.982 [M: 6M, 0B,D: 0B] [DC: 79, 0] ====================================================== 2021-01-27 10:48:25.982 [M: 6M, 0B,D: 0B] [DC: 79, 0] SUMMARY for SIS
最终解释权为: https://www.gbase8.cn/3797
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69979525/viewspace-2759491/ ,如需转载,请注明出处,否则将追究法律责任。