温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

MySQL会话临时表空间有什么作用

发布时间:2020-05-25 11:45:31 来源:网络 阅读:224 作者:三月 栏目:MySQL数据库

本文主要给大家介绍MySQL会话临时表空间有什么作用,文章内容都是笔者用心摘选和编辑的,具有一定的针对性,对大家的参考意义还是比较大的,下面跟笔者一起了解下MySQL会话临时表空间有什么作用吧。                                                          

1、物理文件
[root@roidb1 data]# cd \#innodb_temp/
[root@roidb1 #innodb_temp]# ls -lh
total 160K
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_10.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_1.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_2.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_3.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_4.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_5.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_6.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_7.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_8.ibt
-rw-r-----. 1 mysql mysql 80K Nov 22 18:58 temp_9.ibt
[root@roidb1 #innodb_temp]# 
2、临时表空间目录
mysql> show variables like 'innodb_temp_tablespaces_dir';
+-----------------------------+-----------------+
| Variable_name               | Value           |
+-----------------------------+-----------------+
| innodb_temp_tablespaces_dir | ./#innodb_temp/ |
+-----------------------------+-----------------+
1 row in set (0.00 sec)

使用了新的版本MySQL8.0.18,有很多地方和MySQL5.7有很大的区别。
Defines the location where InnoDB creates a pool of session temporary tablespaces at startup. The default location is the #innodb_temp directory in the data directory. A fully qualified path or path relative to the data directory is permitted.
说明:定义了创建临时表空间池的位置。默认位置为#innodb_temp目录。

As of MySQL 8.0.16, session temporary tablespaces always store user-created temporary tables and internal temporary tables created by the optimizer using InnoDB. (Previously, the on-disk storage engine for internal temporary tables was determined by the internal_tmp_disk_storage_engine system variable, which is no longer supported.
说明:从MySQL8.0.16版本以后,会话临时表空间总是存储创建用户临时表和

内部临时表。

看完以上关于MySQL会话临时表空间有什么作用,很多读者朋友肯定多少有一定的了解,如需获取更多的行业知识信息 ,可以持续关注我们的行业资讯栏目的。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI