summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2006-10-31 17:31:56 -0800
committerigor@rurik.mysql.com <>2006-10-31 17:31:56 -0800
commit2a7acba7e10197ec4a651ae828ff51c0a2ff4747 (patch)
treeb8cf0e80a37eba77a6cccf9e41a8871266533675 /sql/table.cc
parent17eb0b353e5a112e1d0005b71190c1e3278e0583 (diff)
downloadmariadb-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/table.cc')
-rw-r--r--sql/table.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 4dd3494f834..851b747dc83 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -3018,6 +3018,23 @@ void st_table_list::reinit_before_use(THD *thd)
embedding->nested_join->join_list.head() == embedded);
}
+/*
+ Return subselect that contains the FROM list this table is taken from
+
+ SYNOPSIS
+ st_table_list::containing_subselect()
+
+ RETURN
+ Subselect item for the subquery that contains the FROM list
+ this table is taken from if there is any
+ 0 - otherwise
+
+*/
+
+Item_subselect *st_table_list::containing_subselect()
+{
+ return (select_lex ? select_lex->master_unit()->item : 0);
+}
/*****************************************************************************
** Instansiate templates