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