Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
CES Intelligent Postbit Query Details »»
CES Intelligent Postbit Query
Version: 1.0.1, by thincom2000 thincom2000 is offline
Developer Last Online: Sep 2022 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.6.x Rating:
Released: 01-27-2007 Last Update: 02-02-2007 Installs: 28
Code Changes  
No support by the author.

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:
PHP Code:
$lastcheck = ($lastfetchtype == $fetchtype) ? true false
to:
PHP Code:
// $lastcheck = ($lastfetchtype == $fetchtype) ? true : false; 
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 ^_^

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-28-2007, 03:56 AM
winpro19 winpro19 is offline
 
Join Date: May 2006
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yay first to reply and install!! THanks, trying it out now!
Reply With Quote
  #3  
Old 01-28-2007, 04:41 AM
stwilson stwilson is offline
 
Join Date: Dec 2006
Location: USA
Posts: 209
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In your instructions you mention to replace this line
Quote:
$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?
Reply With Quote
  #4  
Old 01-28-2007, 04:55 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 01-28-2007, 06:01 AM
stwilson stwilson is offline
 
Join Date: Dec 2006
Location: USA
Posts: 209
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got it. Clicks installed.
Reply With Quote
  #6  
Old 01-28-2007, 06:13 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 01-28-2007, 06:37 AM
lolo? lolo? is offline
 
Join Date: Jun 2005
Posts: 243
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no change for me it's the same before and after :s
Reply With Quote
  #8  
Old 01-28-2007, 06:38 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 01-28-2007, 10:39 AM
puregraf's Avatar
puregraf puregraf is offline
 
Join Date: May 2006
Posts: 175
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can this work with vb 3.5.4 ? I really need this.

thanks
Reply With Quote
  #10  
Old 01-28-2007, 11:06 AM
winpro19 winpro19 is offline
 
Join Date: May 2006
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply

Thread Tools

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

Forum Jump


All times are GMT. The time now is 07:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05467 seconds
  • Memory Usage 2,296KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete