From 05bf2ebaa8d00e2df564a4017749140b28d38714 Mon Sep 17 00:00:00 2001 From: Anurag Shekhar Date: Thu, 17 Sep 2009 17:35:43 +0530 Subject: Bug #45840 read_buffer_size allocated for each partition when "insert into.. select * from" When inserting into a partitioned table using 'insert into select * from ', read_buffer_size bytes of memory are allocated for each partition in the target table. This resulted in large memory consumption when the number of partitions are high. This patch introduces a new method which tries to estimate the buffer size required for each partition and limits the maximum buffer size used to maximum of 10 * read_buffer_size, 11 * read_buffer_size in case of monotonic partition functions. --- sql/ha_partition.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/ha_partition.h') diff --git a/sql/ha_partition.h b/sql/ha_partition.h index f47dfe8f621..1c863d6c294 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -367,7 +367,8 @@ public: virtual int end_bulk_insert(); private: ha_rows guess_bulk_insert_rows(); - void start_part_bulk_insert(uint part_id); + void start_part_bulk_insert(THD *thd, uint part_id); + long estimate_read_buffer_size(long original_size); public: virtual bool is_fatal_error(int error, uint flags) -- cgit v1.2.1 From 8b9843408d8b1068798228f397cd1a20fa56f504 Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Wed, 23 Sep 2009 15:21:29 +0200 Subject: Bug #43414 Parenthesis (and other) warnings compiling MySQL with gcc 4.3.2 Cleaning up warnings not present in 5.0. --- sql/ha_partition.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql/ha_partition.h') diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 1c863d6c294..c08b1f77eca 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -773,10 +773,10 @@ public: if (m_handler_status < handler_initialized || m_handler_status >= handler_closed) DBUG_RETURN(PARTITION_ENABLED_TABLE_FLAGS); - else - DBUG_RETURN((m_file[0]->ha_table_flags() & - ~(PARTITION_DISABLED_TABLE_FLAGS)) | - (PARTITION_ENABLED_TABLE_FLAGS)); + + DBUG_RETURN((m_file[0]->ha_table_flags() & + ~(PARTITION_DISABLED_TABLE_FLAGS)) | + (PARTITION_ENABLED_TABLE_FLAGS)); } /* -- cgit v1.2.1