[MDEV-21468] Implement status variable to track open temporary tables Created: 2020-01-13  Updated: 2020-01-30

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Temporary, Variables
Fix Version/s: None

Type: Task Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Ralf Gebhardt
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The Open_tables status variable does not take temporary tables into account. For example:

MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'Open_tables';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Open_tables   | 14    |
+---------------+-------+
1 row in set (0.001 sec)
 
MariaDB [(none)]> CREATE TEMPORARY TABLE db1.tmp_tab (id int);
Query OK, 0 rows affected (0.002 sec)
 
MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'Open_tables';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Open_tables   | 14    |
+---------------+-------+
1 row in set (0.001 sec)
 
MariaDB [(none)]> INSERT INTO db1.tmp_tab VALUES (1);
Query OK, 1 row affected (0.000 sec)
 
MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'Open_tables';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Open_tables   | 14    |
+---------------+-------+
1 row in set (0.001 sec)

I think that we should have a status variable that tracks the number of open temporary tables--both globally and for a given session. Maybe it could be called Open_temporary_tables.

Would it also make sense to create Opened_temporary_tables to keep track of all previously opened temporary tables, similar to Opened_tables? Or does Com_create_temporary_table effectively serve the same purpose?


Generated at Thu Feb 08 09:07:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.