← Back to team overview

maria-developers team mailing list archive

Re: [MDEV-7586] Merged derived tables/VIEWs increment created_tmp_tables

 

Hi Vicențiu,

On Sun, Feb 22, 2015 at 10:22:39AM +0200, Vicențiu Ciorbaru wrote:
> diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
> index d5e3334..2122349 100644
> --- a/sql/opt_subselect.cc
> +++ b/sql/opt_subselect.cc
> @@ -3890,7 +3890,6 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
>    /*
>      STEP 1: Get temporary table name
>    */
> -  thd->inc_status_created_tmp_tables();
>    if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES))
>      temp_pool_slot = bitmap_lock_set_next(&temp_pool);
>
What is this part for?
It seems to be incorrect:


create table ten(a int);
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);

create table t1 (a int, b int);
insert into t1 select a,a from test.ten;
explain select a from t1 where a in (select a from t2 where t2.b=t1.b);
flush status;
select a from t1 where a in (select a from t2 where t2.b=t1.b);
+------+
| a    |
+------+
|    0 |
|    1 |
|    2 |
|    3 |
|    4 |
|    5 |
|    6 |
|    7 |
|    8 |
|    9 |
+------+

show status like '%tmp%';
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 0     |
| Created_tmp_files       | 0     |
| Created_tmp_tables      | 0     |
| Handler_tmp_update      | 0     |
| Handler_tmp_write       | 10    |
| Rows_tmp_read           | 6     |
+-------------------------+-------+

So, Created_tmp_tables=0 while Handler_tmp_write!=0 ?

BR
 Sergei
-- 
Sergei Petrunia, Software Developer
MariaDB Corporation | Skype: sergefp | Blog: http://s.petrunia.net/blog




References