Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

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
  #52  
Old 01-28-2007, 10:46 PM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TheFrienzNet View Post
As seen from your profile card, you are using vBulletin 3.5.4. This hack only supports 3.6.x.
Im using 3.6.4 my profile was not updated.
Reply With Quote
  #53  
Old 01-28-2007, 10:46 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by COBRAws View Post
I was having the Steal sigs bug, now I updated with the new code replacements (replaced just the first instances and the two).

Anything I do, I get the following error msg:


mmm
That happened to me while during primary testing. On vBulletin 3.6.4 it happens when you have:
PHP Code:
$lastfetchtype = ($lastfetchtype != $fetchtype) ? $fetchtype $lastfetchtype;
$lastcheck = ($lastfetchtype == $fetchtype) ? true false
instead of
PHP Code:
$lastcheck = ($lastfetchtype == $fetchtype) ? true false;
$lastfetchtype = ($lastfetchtype != $fetchtype) ? $fetchtype $lastfetchtype
Reply With Quote
  #54  
Old 01-28-2007, 10:51 PM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thincom2000 View Post
That happened to me while during primary testing. On vBulletin 3.6.4 it happens when you have:
PHP Code:
$lastfetchtype = ($lastfetchtype != $fetchtype) ? $fetchtype $lastfetchtype;
$lastcheck = ($lastfetchtype == $fetchtype) ? true false
instead of
PHP Code:
$lastcheck = ($lastfetchtype == $fetchtype) ? true false;
$lastfetchtype = ($lastfetchtype != $fetchtype) ? $fetchtype $lastfetchtype
Thanks, quick replier but im using 3.6.4 as on my last message. Sorry for not updating my profile info.
Reply With Quote
  #55  
Old 01-28-2007, 11:03 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In that case please post your showthread.php (stripped of license data), and I'll take a look at it.
Reply With Quote
  #56  
Old 01-28-2007, 11:20 PM
Kiros72 Kiros72 is offline
 
Join Date: Apr 2006
Location: Albany, LA - USA
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any reason the queries would appear to be the same (before and after the hack)?
Reply With Quote
  #57  
Old 01-28-2007, 11:32 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For each post, -1 query. For each signature +1 query.

It would appear to be the same if the number of different signatures and posts are the same. In its current form, this would only be beneficial if the same people keep posting in a thread.

EDIT: That's completely untrue. I just looked at the code again, and at my site, and this does not add queries for signatures.

There is no reason I can think of why you should not be getting QUERIES SAVED = NUMBER OF POSTS ON PAGE - 1.

Do you have any hacks that run on postbit hooks ?
Reply With Quote
  #58  
Old 01-28-2007, 11:55 PM
Cap'n Steve's Avatar
Cap'n Steve Cap'n Steve is offline
 
Join Date: Feb 2004
Location: Kalamazoo, MI, USA
Posts: 745
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe I'm missing what exactly this hack does, but I know that default vBulletin doesn't do a query for every post. If you have more than 20 queries or so, then something is very wrong.
Reply With Quote
  #59  
Old 01-29-2007, 12:17 AM
Get Shorty's Avatar
Get Shorty Get Shorty is offline
 
Join Date: Jun 2006
Location: Baton Rouge, LA
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cap'n Steve View Post
Maybe I'm missing what exactly this hack does, but I know that default vBulletin doesn't do a query for every post. If you have more than 20 queries or so, then something is very wrong.
Yeah, like I mentioned, I didn't see any change in query usage.
Reply With Quote
  #60  
Old 01-29-2007, 12:50 AM
Kiros72 Kiros72 is offline
 
Join Date: Apr 2006
Location: Albany, LA - USA
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cap'n Steve View Post
Maybe I'm missing what exactly this hack does, but I know that default vBulletin doesn't do a query for every post. If you have more than 20 queries or so, then something is very wrong.
No, I don't have any hacks that would modify the postbits - not that I'm aware of
Reply With Quote
  #61  
Old 01-29-2007, 01:49 AM
G_Man G_Man is offline
 
Join Date: Feb 2006
Location: Washington State
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cap'n Steve View Post
Maybe I'm missing what exactly this hack does, but I know that default vBulletin doesn't do a query for every post. If you have more than 20 queries or so, then something is very wrong.

I just uninstalled since my queries were exactly the same as before making the edits. It sure seems to be helping on some forums though.

Hopefully something can be found to establish this benefit. I have a few mods boosting my queries to around 27-35 or so...
Reply With Quote
Reply


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 05:44 AM.


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.11436 seconds
  • Memory Usage 2,332KB
  • Queries Executed 25 (?)
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
  • (6)bbcode_php
  • (6)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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