vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=265785

slow query for thread.forumid. help me optimize
by ThorstenA
25 Jun 2011 14:30

This query is slow (0.15 seconds) despite of having indexes everywhere.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

These both queries are fast when removing either forumid=1 or the attachment table. Why is that? How can I rewrite my #1 query to make it faster?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 25 Jun 2011 at 14:35 ---------------

Found the solution. This is extremely fast. The forumid restriction in the inner join thread seems to be very good.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Pandemikk 27 Jun 2011 06:17

Glad you found the solution. Before you were selecting all threads and then applying the forumid restriction!

Happy coding.

p.s. you don't need those parenthesis for the on clause, in case you didn't know.


All times are GMT. The time now is 00:12.

Powered by vBulletin® Version 3.8.12
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.