954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

MySQL Memory Problems When Sorting Multiple Columns

I am running mySQL Server 5.0.37 on a Windows 2003 Server.

I have a table that I want sorted by three columns (column1, then column2, then column3).

I can sort one column just fine. But, if the recordset is large, sorting by two (or more) columns crashes the mySQL Server Service.

Through research it looks like I am having a memory problem as the following error message is written to the MySQL error log:

080325 14:27:10 [ERROR] C:\SWsoft\Plesk\Databases\MySQL\bin\mysqld-nt.exe: Out of memory; restart server and try again (needed 32776 bytes)


The my.ini file shows the following values:

sort_buffer_size=256K
sort_buffer=256K


Oddly enough, phpMyAdmin shows the following:

sort buffer size 32,776


I increased the sort_buffer_size and sort_buffer in my.ini to 512k, but this did not help.

I am also concerned that if I successfuly increase the buffer sizes too big, I will have problems with my Windows Server (512MB) if I have a large number of users running this query at the same time.

Any help on how I can resolve this would be greatly appreciated.

WayCoolJr
Newbie Poster
1 post since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

You might want to investigate indexing.

trudge
Junior Poster
178 posts since Sep 2007
Reputation Points: 18
Solved Threads: 20
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You