mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user