FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » Database discussions » Query taking 2 minutes (Board grinds to halt for that period of time)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Query taking 2 minutes [message #161908 is a reply to message #161907] Fri, 19 February 2010 20:54 Go to previous messageGo to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma:
Senior Member
Administrator
Core Developer
OK, the slow-down is probably caused by fetching 15724 rows from fud26_thread. MySQL uses the thread_i_flm index (which is probably not selective enough).

Looking at the query, candidate keys would be:

* id
* root_msg_id
* forum_id
* last_post_date (in ORDER BY)

Existing indexes:

* PRIMARY (id)
* thread_i_flm (forum_id, moved_to) <-- use for leading col.
* thread_i_t (thread_opt)
* thread_i_rmi (root_msg_id)
* thread_i_r (replies)

Will you be able to create some indexes to see it they will help?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Cannot connect to database
Next Topic: Has anyone tried to use this w/SQL Server 2000
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 02:19:13 GMT 2024

Total time taken to generate the page: 0.06119 seconds