[MDEV-11173] If a materialized VIEW is used multiple times in a query, several temporary tables are created Created: 2016-10-29  Updated: 2017-02-25

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Temporary, Views
Affects Version/s: 10.2
Fix Version/s: 10.2

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5535 cannot reopen temporary table Closed

 Description   

There is a couple of comments to MDEV-5535 which makes me think that something does not work quite as expected:

Sergei Petrunia added a comment - 2015-11-26 03:33
<...>
[No MDEV yet] Materialized view processing. Currently, if a materialized VIEW is used multiple times in the query, several temporary tables will be created and populated.

Sergei Golubchik added a comment - 2015-11-26 19:08
Nirbhay Choubey, note the comment above. It means that one should be able to reopen internal temporary tables too.

Currently it looks like it works the old way (or maybe I misunderstood what the new way should be):

MariaDB [test]> create algorithm=temptable view v1 as select 1;
Query OK, 0 rows affected (0.27 sec)
 
MariaDB [test]> flush status;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> select * from v1 v1a, v1 v1b;
+---+---+
| 1 | 1 |
+---+---+
| 1 | 1 |
+---+---+
1 row in set (0.00 sec)
 
MariaDB [test]> show status like 'Created_tmp_tables';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| Created_tmp_tables | 2     |
+--------------------+-------+
1 row in set (0.00 sec)

If it's indeed not the desired behavior, I'm not sure whether it's because something wasn't done in the scope of MDEV-5535, or because it requires additional changes in view processing. In the latter case, please feel free to convert this bug into a task and edit summary/description as necessary.


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