diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-04-01 18:03:14 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-04-01 18:03:14 +0400 |
commit | 763af1a8a3a894df7326303b062bc55121103cb0 (patch) | |
tree | 6cf152307269bd37d1652c82c860fbf1fae5e194 /sql/opt_range.h | |
parent | 3345e7564d033313ac54ca34d1505d6a2e78cdad (diff) | |
download | mariadb-git-763af1a8a3a894df7326303b062bc55121103cb0.tar.gz |
MDEV-4240: mariadb 5.3.12 using more memory than MySQL 5.1 for an inefficient query
- Let index_merge allocate table handlers on quick select's MEM_ROOT,
not on statement's MEM_ROOT.
This is crucial for big "range checked for each record" queries, where
index_merge can be created and deleted many times during query exection.
We should not make O(#rows) allocations on statement's MEM_ROOT.
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r-- | sql/opt_range.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index d4b92015042..17bb6d16da8 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -310,7 +310,7 @@ public: 0 Ok other Error */ - virtual int init_ror_merged_scan(bool reuse_handler) + virtual int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc) { DBUG_ASSERT(0); return 1; } /* @@ -448,7 +448,7 @@ public: uchar *cur_prefix); bool reverse_sorted() { return 0; } bool unique_key_range(); - int init_ror_merged_scan(bool reuse_handler); + int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc); void save_last_pos() { file->position(record); } int get_type() { return QS_TYPE_RANGE; } @@ -681,7 +681,7 @@ public: #ifndef DBUG_OFF void dbug_dump(int indent, bool verbose); #endif - int init_ror_merged_scan(bool reuse_handler); + int init_ror_merged_scan(bool reuse_handler, MEM_ROOT *alloc); bool push_quick_back(MEM_ROOT *alloc, QUICK_RANGE_SELECT *quick_sel_range); class QUICK_SELECT_WITH_RECORD : public Sql_alloc |