tags:

views:

243

answers:

1

I am running MySQL 5.1 on my windows vista installation. The table in question uses MyISAM, has about 10 million rows. It is used to store text messages posted by users on a website.

I am trying to run the following query on it,

query = "select id, text from messages order by id limit %d offset %d" %(limit, offset)

where limit is set to a fixed value (in this case 20000) and offset is incremented in steps of 20000.

This query goes into an infinite loop when offset = 240000. This particular value and not any other value.

I isolated this query into a script and ran it, and got the same results. I then tried to run the last query (with offset = 240000) directly, and it worked !

I then tried executing the same queries directly in a mysql client to make sure that the error was not in the python DB accessor module. All the queries returned results, except the one with offset = 240000.

I then looked at the mysql server logs and saw the following.

[ERROR] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Sort aborted

This probably means that when I stopped the python process (out of frustration), the mysqld process was 'sorting' something. When I looked at the my.ini file, I saw a lot of MAX_* options. I am currently experimenting with these, but just throwing it out there in the meanwhile.

Any help appreciated!

A: 

Have you checked the table with myisamchk?

newtover