diff options
author | igor@rurik.mysql.com <> | 2006-10-31 17:31:56 -0800 |
---|---|---|
committer | igor@rurik.mysql.com <> | 2006-10-31 17:31:56 -0800 |
commit | 2a7acba7e10197ec4a651ae828ff51c0a2ff4747 (patch) | |
tree | b8cf0e80a37eba77a6cccf9e41a8871266533675 /sql/sql_select.cc | |
parent | 17eb0b353e5a112e1d0005b71190c1e3278e0583 (diff) | |
download | mariadb-git-2a7acba7e10197ec4a651ae828ff51c0a2ff4747.tar.gz |
Fixed bug #21727.
This is a performance issue for queries with subqueries evaluation
of which requires filesort.
Allocation of memory for the sort buffer at each evaluation of a
subquery may take a significant amount of time if the buffer is rather big.
With the fix we allocate the buffer at the first evaluation of the
subquery and reuse it at each subsequent evaluation.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1dce7390ef1..d00795e0b14 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1260,14 +1260,14 @@ JOIN::reinit() exec_tmp_table1->file->extra(HA_EXTRA_RESET_STATE); exec_tmp_table1->file->delete_all_rows(); free_io_cache(exec_tmp_table1); - filesort_free_buffers(exec_tmp_table1); + filesort_free_buffers(exec_tmp_table1,0); } if (exec_tmp_table2) { exec_tmp_table2->file->extra(HA_EXTRA_RESET_STATE); exec_tmp_table2->file->delete_all_rows(); free_io_cache(exec_tmp_table2); - filesort_free_buffers(exec_tmp_table2); + filesort_free_buffers(exec_tmp_table2,0); } if (items0) set_items_ref_array(items0); @@ -6066,7 +6066,7 @@ void JOIN::cleanup(bool full) if (tables > const_tables) // Test for not-const tables { free_io_cache(table[const_tables]); - filesort_free_buffers(table[const_tables]); + filesort_free_buffers(table[const_tables],full); } if (full) |