List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:June 10 1999 7:00am
Subject:Performance
View as plain text  
>>>>> "Para-dox" == Para-dox  <paradox@stripped> writes:

Para-dox> Ok, importing finally worked, it was actually completely unrelated to the "
thing, its just that the text file was corrupt.
Para-dox> Now, I am accessing my newly imported table from a program of mine using the
MySQL C API.

Para-dox> I issued the following SQL:

Para-dox> SELECT INVNUM, CUSTNAME, PHONE, TOTAL FROM INVOICES ORDER BY CUSTNAME;

Para-dox> and called mysql_store_result() and then accessed the rows from there
perfectly fine.

Para-dox> However....

Para-dox> It takes about 10 to 15 seconds to process the query and mysql_store_result()
and allocates several megabytes of RAM.
Para-dox> Any way for me to speed this up? There are 60,000 records...about 40 fields
in the INVOICES table. I can't do mysql_use_result() since I need the ability to seek
using row offset #. The mysql connection is to localhost and the machine is a dual PII
400+400, w/ 256 MB ram, so it should be fast. It needs to load up in under a half a
second. The CUSTNAME field is indexed along with about 10 other fields. Any suggestions
would be appreciated, thanks..

Hi!

Please check that you don't have compiled MySQL with --with-debug;  In 
this case it's the memory checking package that gives you a big
performance hit.

Try the query without 'ORDER BY';  Is it faster this way?

The memory needed for the client is appromaxly:

number_of_rows* (8 + number_of_columns*5) +
space_for_data_in_string_format_without_null_terminator

(For a machine with 4 byte pointers)

Regards,
Monty
Thread
PerformancePara-dox10 Jun
  • PerformanceMichael Widenius10 Jun