Bug #47659 | DISTINCT causes an OUT OF MEMORY error | ||
---|---|---|---|
Submitted: | 27 Sep 2009 7:48 | Modified: | 28 Oct 2009 3:26 |
Reporter: | Bing Wu | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: General | Severity: | S2 (Serious) |
Version: | 5.0.75 | OS: | Linux (Ubuntu 9.04) |
Assigned to: | CPU Architecture: | Any | |
Tags: | distinct, out of memory |
[27 Sep 2009 7:48]
Bing Wu
[27 Sep 2009 8:32]
Valeriy Kravchuk
Thank you for the problem report. Please, send the results of: show table status like ' contact_records'\G and file mysqld Linux command. I want to check how big the table is and is your MySQL server 32-bit one. In the meantime, try to set tmp_table_size and max_heap_table_size to some more reasonable values for the RAM you have. 100M or so maybe. This should allow you to execute the query successfully.
[27 Sep 2009 23:36]
Bing Wu
Valeriy Per your request, here is result of "show table status" *************************** 1. row *************************** Name: contact_records Engine: MyISAM Version: 10 Row_format: Dynamic Rows: 4109999 Avg_row_length: 166 Data_length: 684243488 Max_data_length: 1099511627775 Index_length: 197521408 Data_free: 0 Auto_increment: 4110000 Create_time: 2009-09-27 16:14:21 Update_time: 2009-09-27 16:15:27 Check_time: 2009-09-27 16:16:20 Collation: utf8_general_ci Checksum: NULL Create_options: max_rows=100000000 Comment: ----------------------- "file mysqld" is - ~# file /usr/sbin/mysqld /usr/sbin/mysqld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped ------------------------ Please note, the OOM error does not happen to the contact_records table only. It happens whenever I have to do a "distinct", "count group by" on a large set. As for tmp_table_size and max_heap_table_size - I need to dynamically create and destroy some large tmp tables. And I thought when memory is running low, the temp/memory tables will get a out-of-memory error first. So I kept them high. I will change and try again.
[28 Sep 2009 3:26]
Valeriy Kravchuk
Please, change as I suggested and inform about the results. 32-bit mysqld is limited to 2G or so of memory allocated for all needs, so temporary tables in memory can NOT be 2+ G in size in any case.
[29 Oct 2009 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".