Jump to content

Slow Query Running/Page Rendering While MySQL Event Is Being Executed


Go to solution Solved by Barand,

Recommended Posts

Hi All,
I have a form that enables the user to know events that occur in a specific city. Most of the time they get the results in a few seconds, despite the fact that many rows in various tables might be searched for detailed infos about the events in that city.
However, this form partly relies on a table against which a MySQL event regularly does some operations. If the user uses the form while the event is being executed, they have to wait up to 30 seconds before getting the results, and sometimes only part of the html page is generated.
Is there a way to avoid this lengthy waiting time ?
I am wondering whether or not the best would be putting the site on maintenance while the event is being executed, with a "please come back in a few minutes" message.
Thanks in advance for your help.
 

 


Is there a way to avoid this lengthy waiting time ?

 

Possibly. From the information that you have given us I am sure any of the psychics on the forum could help.

The best thing you can do to speed up queries is to have the fields that are being JOINed ON, ORDERed BY, GROUPed BY, or used in a WHERE, properly indexed. Also learning to use EXPLAIN will help see where the bottlenecks are.

 

http://www.sitepoint.com/optimizing-mysql-indexes/

  • Solution

As well as the table structure the query syntax used can also affect performance and, for all we know, you could be running multiple queries inside loops. You have given us absolutely no information for us to help you.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.