Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Serious Query Problem Details »»
Serious Query Problem
Version: , by TheSaint-AeD TheSaint-AeD is offline
Developer Last Online: Jan 2004 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-22-2002 Last Update: Never Installs: 0
 
No support by the author.

I have a serious Problem with the Querries in showthread.php. Everytime I post in an Thread, next time I open the thread it needs exactly 2 Querries more. As I have 25 Threads / Page this means 50 additional Querries on a full Page! As I already have about 25 Querries as default, i got between 30-80 Querries in a Thread

Can anybody explain to my why this happens and why other users on my board don't seem to add so many querries per post? I have access-masks enabled and Quick-Reply + Lesanes Award-System + Quick Delete installed.

Show Your Support

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

Comments
  #2  
Old 10-22-2002, 03:49 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it seems you have a query call within a while loop

open admin/functions.php
got to function getpostbit

if you find any query in this function, you should take it out.
Reply With Quote
  #3  
Old 10-23-2002, 06:29 AM
TheSaint-AeD's Avatar
TheSaint-AeD TheSaint-AeD is offline
 
Join Date: Sep 2002
Location: Munich
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Found this

PHP Code:
if ($post[award]=="1")
    {
         
$result=$DB_site->query("SELECT * FROM useraward WHERE userid='$post[userid]' AND awardsid=aw ");
       while (
$awardsp=$DB_site->fetch_array($result))
        {
          eval(
"\$post[hasaward] .= \"".gettemplate("awards")."\";");

        }
   } 
This is the only query performed in getpostbit, may there be some messed codes in Lesanes Award-Hack? Me and some other Useres got even more Problems with it. Sometimes donating an Award doubles all DB-Entries which is only shown in user.php but not in awards.php.
Reply With Quote
  #4  
Old 10-23-2002, 02:17 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok this is the problem which produces the high query ammount.

you should read the supportthread of lesanes hack, maybe there is a new method to save this query.

if this query couldn't be saved without changen a larg ammount of code, maybe a cache can help.

you should suggest that
Reply With Quote
  #5  
Old 10-23-2002, 02:38 PM
TheSaint-AeD's Avatar
TheSaint-AeD TheSaint-AeD is offline
 
Join Date: Sep 2002
Location: Munich
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thx 4 your help, Xenon, but I don't know enough about PHP + MySQL to solve this Problem myself. I read the whole Support Thread (which is quite long ) 3 Times because I couldn't believe noone else notices the Problems with the Hacks, but it seems, as if I was the only one.

I don't think there's gonna be a fix of Lesane, as he already had to give up his "Tribute to 2Pac" Board due to his lack of Time. Could anybody else of the vb.org-Staff take care of that Thread? Missing the Award-Hack would be missing one of the most ruling Features of vB
Reply With Quote
  #6  
Old 10-23-2002, 02:53 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't take out that query. It's just a query wich is needed to get the awards from an user.

I'm no supporter for while loops in the posbit as well. You could move the awards to the userinfo page.

How many awards do you have?
Reply With Quote
  #7  
Old 10-23-2002, 03:00 PM
TheSaint-AeD's Avatar
TheSaint-AeD TheSaint-AeD is offline
 
Join Date: Sep 2002
Location: Munich
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've got about 20 Awards in total and an average of 1-2 per User. Due to the other Problem (Awards get Duplicated when giving to certain users) I deleted all Awards, but still the same Problem.

Man, Lesane, that was fast . Are you the Neighbour of Xenon? *G*
Reply With Quote
  #8  
Old 10-23-2002, 03:12 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A new version of the awards hack is coming within a few weeks. The new version will have no query's in the postbit anymore.

First i am going to finish the new version of the store hack.
Reply With Quote
  #9  
Old 10-23-2002, 03:32 PM
TheSaint-AeD's Avatar
TheSaint-AeD TheSaint-AeD is offline
 
Join Date: Sep 2002
Location: Munich
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll be looking nervously forward to it, refreshing vb.org every 10 minutes ^^ Btw, Lesane: You had a great board, I'm missing it already though I had only few time to visit it.
Reply With Quote
  #10  
Old 10-23-2002, 03:52 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ahh, good to hear lesane

@Saint: hmm, you can try this, it will save at least some of the queries if you have more posts of the same user on one page:

change the postbit code to this:
PHP Code:
if ($post[award]=="1")
    {
         if(
isempyt($awardresultcache[$post['userid']]) $awardresultcache[$post['userid']]=$DB_site->query("SELECT * FROM useraward WHERE userid='$post[userid]' AND awardsid=aw ");
       while (
$awardsp=$DB_site->fetch_array($awardresultcache[$post['userid']]))
        {
          eval(
"\$post[hasaward] .= \"".gettemplate("awards")."\";");

        }
   } 
then in getpostbitfunction after
PHP Code:
    global $bbuserinfo,$session,$ignore,$cookietimeout
add this:
PHP Code:
 static $awardresultcache 

i think this should reduce the query ammount
Reply With Quote
  #11  
Old 10-23-2002, 08:06 PM
TheSaint-AeD's Avatar
TheSaint-AeD TheSaint-AeD is offline
 
Join Date: Sep 2002
Location: Munich
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I already deinstalled the Hack and went back to less than 40 Querries in showthread .

@ Xenon: Danke trotzdem vielmals f?r die schnelle und kompetente Hilfe
Reply With Quote
  #12  
Old 10-23-2002, 09:29 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you're welcome

hmm, du solltest nicht ?ber 35 kommen bei showthread, unter 30 w?re noch besser
Reply With Quote
  #13  
Old 10-24-2002, 04:52 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by TheSaint-AeD
I already deinstalled the Hack and went back to less than 40 Querries in showthread .
40 queries is still significant. Try to reduce it a bit more - ideally to 25 or less, since showthread is the most commonly accessed page on a forum.
Reply With Quote
  #14  
Old 10-24-2002, 08:37 AM
TheSaint-AeD's Avatar
TheSaint-AeD TheSaint-AeD is offline
 
Join Date: Sep 2002
Location: Munich
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hrhr

I know that ~35 Querries is a lot on showthread, but my Servers are good enough to face this, and I don't wanna miss any of the Features causing these Querries. Visit me on http://foren.gslallianz.de if you want Still a lot under Construction, but already some interessting things to see

--------------------

Xenon, there seems to be another Query-Loop. Seems to have something to do with the Quick-Delete Post Hack, I'm investigating atm. and post the Results as soon as possible.
Reply With Quote
  #15  
Old 10-24-2002, 08:50 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes this is important to put away

don't use queries in loops .

most of the time these queries can be avoided with good joined queries.... but not always
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 01:05 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.05362 seconds
  • Memory Usage 2,356KB
  • Queries Executed 28 (?)
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
  • (4)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
  • (1)pagenav_pagelink
  • (15)post_thanks_box
  • (15)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (15)post_thanks_postbit_info
  • (14)postbit
  • (15)postbit_onlinestatus
  • (15)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