Page 1 of 1
Slow query opening
Posted: Mon 03 Jul 2006 04:49
by jarot
Running the application with the application's exe and MySQL server on the same computer is always fast.
But when we tried to run the application from another computer, sometimes its slow, sometimes its normal.
What could possibly be the problem. I'm sure there's nothing wrong with the network connection.
Thanks.
Posted: Mon 03 Jul 2006 12:59
by Antaeus
Try to determine what actions slow down your application: connecting to the server, fetching data, executing INSERT, UPDATE, DELETE queries or something else.
Posted: Tue 04 Jul 2006 22:31
by GEswin
If it's connecting to the database, check this:
http://dev.mysql.com/doc/refman/5.1/en/dns.html
Add the skip-name-resolve to your my.ini/cnf
If it's when opening the query (you're already connected), then look at the amount of data fetched. If you select all fields and only need a few ones, then adjust your query to retrieve only data you need. Retrieving big blobs also takes its time, sometimes it's better to get blobs only when you need them.
Regards
Re:
Posted: Wed 05 Jul 2006 04:27
by jarot
Thanks for the quick reply.
Antaeus, it seemed to be OK when we tried to connect to the database.
The problem started whenever we tried to fetch a data via TMyQuery. Simple query from a small table like
'select UserName from UserLogin where UserID = 1'
which returns 1 record requires a considerable time to execute (about 1 minute).
To GEswin, we only select the required fields. We never use 'select *' nor we ever select BLOB fields for a query that returns more than 1 records (e.g. for listing purpose).
Posted: Wed 05 Jul 2006 11:10
by Antaeus
Please try to execute the same query with any other tool. For example standard MySQL client.