PDA

View Full Version : Optimize a SELECT code (vB code)


Swedie
06-27-2007, 06:47 PM
I'm having issues on my server with a huge amount of slow queries like this one:

SELECT postid, visible, userid

FROM post AS post

WHERE threadid = 124608

AND visible IN (1

,2

)

ORDER BY dateline;


Only thing that changed is the threadid.

I have query times of 20-50 seconds on each of these queries. It's bogging down the server.

So how can that code be optimized further? What about separating the dateline ordering into a php based sorting (array sort).

Xplorer4x4
06-27-2007, 08:23 PM
I think it may be an issue with your mysql server and not really require optimization.

Eikinskjaldi
06-27-2007, 09:32 PM
What does explain say?