Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
CES Intelligent Postbit Query Details »
CES Intelligent Postbit Query
Mod Version: 1.0.1, by thincom2000 (Coder) thincom2000 is offline
Developer Last Online: Oct 2019 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.x Rating: (5 votes - 4.80 average) Installs: 26
Released: 28 Jan 2007 Last Update: 03 Feb 2007 Downloads: 105
Supported Code Changes  

CES Intelligent Postbit Query
Version: 1.0.1

This hack is now used as a troubleshooting tool for members with unusually high queries on showthread. You do not need to install this unless your queries peak around 20 or higher.

Note that if after installing this you experience a drop in queries, it means you have a bad plugin installed. Leaving this installed, while this does not hurt your forum at all, does not solve your query problem - it only now hides it.

To disable the tool, you only need to change the line:

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

to:

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

Post your query success stories in the thread!

For those without success (i.e. it doesn't seem to make a difference), please don't uninstall, but help us determine what is different in your case. PHP version, MySQL version, hacks installed, PHP cache, etc. would all be useful information. Thanks!


*** NEWS ***
This section has become a list of bad plugins. Often these plugins can be optimized by a rewrite using a different hook, and thus not causing this query issue.

Product: Username Management
Hook Location: postbit_factory
Bad Plugin: Add Username history to postbit(legacy)

1/28/2007 - v1.0.0, v1.0.1 released

I actually came across this while trying to reduce queries in my CES Site News mod which uses a customized showthread.php.

Known Issues:
- NONE

- Some users see an amazing improvement, others do not see a difference in query count for some time, while still others don't see any difference at all. It all depends on your server setup and your current vBulletin installation (settings, other mods, etc). This hack is still young (1 day) so we haven't narrowed down what causes these differences in success.

- If you are still experiencing the stolen signatures issue, you need to clear your sig_cache. Do this by going to AdminCP -> Maintenance -> Update Counters -> Empty Signature Cache.

What It Does:
On some installations showthread wastes 1 query per post in showthread.php when creating the postbits. You can tell if this applies to your installation if you approach or exceed 20 queries on a page of only 10 or so posts.

By adding these 4 lines, showthread checks to see if it already has created the appropriate Postbit Factory object instead of doing it all over again. Queries on showthread are thus DRASTICALLY reduced (1 per post), even though the code reveals no direct database references.

This can be a HUGE performance boost.

I hope someone from Jelsoft sees this thread...

Mod Features:
- removes multiple pointless queries

Products to Install: 0
Plugins Included: 0
Files to Upload: 0
Files to Edit: 1
New Templates: 0
Template Edits: 0
Queries Added*: -1

*See "What It Does" for details.

*** Changelog ***
As of Version 1.0.1:
- fixed bug where posts would "steal" signatures from each other
Special thanks to TheFrienzNet for his help ^_^

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Show Thread Enhancements CES Intelligent Attachment Query thincom2000 vBulletin 3.6 Add-ons 21 08 Mar 2008 08:28
Forum Display Enhancements CES Intelligent Announcement Query thincom2000 vBulletin 3.6 Add-ons 17 29 Jan 2007 00:13

Comments
  #2  
Old 28 Jan 2007, 05:56
winpro19 winpro19 is offline
 
Join Date: May 2006
Yay first to reply and install!! THanks, trying it out now!
Reply With Quote
  #3  
Old 28 Jan 2007, 06:41
stwilson stwilson is offline
 
Join Date: Dec 2006
Real name: ST
In your instructions you mention to replace this line
$postbit_obj =& $postbit_factory->fetch_postbit($fetchtype);
You do not mention to replace it twice. My showthread file has the above line listed in two different locations. Should I replace both of them with your suggested changes?
__________________
ST
Reply With Quote
  #4  
Old 28 Jan 2007, 06:55
thincom2000 thincom2000 is offline
 
Join Date: Jun 2006
Real name: Ted
You can replace both if you want. The second instance of the line is for Hybrid / Threaded Modes which are the boring threadlists you sometimes get from search engines. If you don't have Hybrid / Threaded Mode enabled on your forum, changing that section of showthread.php is not necessary.
Reply With Quote
  #5  
Old 28 Jan 2007, 08:01
stwilson stwilson is offline
 
Join Date: Dec 2006
Real name: ST
Got it. Clicks installed.
__________________
ST
Reply With Quote
  #6  
Old 28 Jan 2007, 08:13
thincom2000 thincom2000 is offline
 
Join Date: Jun 2006
Real name: Ted
If everyone could please post the number of queries they save on a full page of posts, that would be awesome.

Here's mine: 22 - 10 = 12.
Reply With Quote
  #7  
Old 28 Jan 2007, 08:37
lolo² lolo² is offline
 
Join Date: Jun 2005
no change for me it's the same before and after :s
Reply With Quote
  #8  
Old 28 Jan 2007, 08:38
thincom2000 thincom2000 is offline
 
Join Date: Jun 2006
Real name: Ted
How many posts were in the thread? Link?

Also the page you are checking might still be cached in your browser. This doesn't happen much with regards to queries but happened to me a few times today.
Reply With Quote
  #9  
Old 28 Jan 2007, 12:39
puregraf's Avatar
puregraf puregraf is offline
 
Join Date: May 2006
can this work with vb 3.5.4 ? I really need this.

thanks
Reply With Quote
  #10  
Old 28 Jan 2007, 13:06
winpro19 winpro19 is offline
 
Join Date: May 2006
Question

Hmm...this is probably a stupid question...but how do I determine the number of queries on my page? Let me know ,

Thanks guys
Reply With Quote
  #11  
Old 28 Jan 2007, 13:27
Darat Darat is offline
 
Join Date: Aug 2004
I've tried it on a page of default number of posts (40) - which generated 95 queries before and 95 queries afterwards.

So seems to have no effect.


By the way what is this line used for:

$lastfetchtype = ($lastfetchtype != $fetchtype) ? $fetchtype : $lastfetchtype;

You don't seem to make any reference to $lastfetchtype?
Reply With Quote
  #12  
Old 28 Jan 2007, 15:37
thincom2000 thincom2000 is offline
 
Join Date: Jun 2006
Real name: Ted
$lastfetchtype is a new string this adds to track what the last generated postbit was (i.e. a post, PM, etc.)


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

means:

If $lastfetchtype equals this $fetchtype, $lastcheck equals true, otherwise $lastcheck equals false.
Now that we know what $lastfetchtype is, we can bother changing it. If $lastfetchtype is not the same as this $fetchtype, update it, otherwise leave it alone.

There should be no need to reference $lastfetchtype.

Are you using Linear or Hybrid / Threaded Modes on your forum?

EDIT: Here's some screenshots to show this actually did something for me. I'm really clueless as to why it wouldn't work for others. I'll restore my backup showthread and check it out.

EDIT: I restored my backup and tried it again. No problems. Note that the line


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

appears twice in showthread (line 1046 and line 1507), and for the most part we are only modifying the first appearance. If you are experiencing problems, try changing it at both places
Attached Images
File Type: jpg before.jpg (37.0 KB, 81 views)
File Type: jpg after.jpg (37.0 KB, 77 views)

Last edited by thincom2000; 28 Jan 2007 at 16:03.
Reply With Quote
  #13  
Old 28 Jan 2007, 16:33
thincom2000 thincom2000 is offline
 
Join Date: Jun 2006
Real name: Ted
Originally Posted by winpro19 View Post
Hmm...this is probably a stupid question...but how do I determine the number of queries on my page? Let me know ,

Thanks guys
I'm actually wondering this too. Since I already have it enabled, can't find the setting now, and will be wanting to disable it in the future.

EDIT: http://www.vbulletin.org/forum/showthread.php?t=82900

Last edited by thincom2000; 28 Jan 2007 at 17:10.
Reply With Quote
  #14  
Old 28 Jan 2007, 17:03
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Real name: Jack
wow!

I had a thread with 101 posts, after doing this changes I had 136 queries, now I just have 35!
Good work mate. But, is there any problems doing these edits?
__________________
cobraws

Last edited by COBRAws; 28 Jan 2007 at 17:07.
Reply With Quote
  #15  
Old 28 Jan 2007, 17:08
thincom2000 thincom2000 is offline
 
Join Date: Jun 2006
Real name: Ted
Shouldn't be any problems. Unless you have a page with different postbits:

like it shows PMs, and posts, and post-legacies on the same page,
but the $lastfetchtype check should eliminate those problems.

Glad to hear about that success that's an awesome reduction. Unless someone has issues where it actually messes up functionality, I'm hoping for a MOTM XD, or at least Jelsoft putting it in 3.7.x.

Last edited by thincom2000; 28 Jan 2007 at 17:12.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 18:53.

Layout Options | Width: Wide Color: