vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   67 queries?! (https://vborg.vbsupport.ru/showthread.php?t=44980)

X-Fan 10-25-2002 02:51 PM

67 queries?!
 
G'day all,

Hoping someone can help me nail down why my showthread.php is generating 67 queries!

Take a look at this page:

http://x-mencomics.com/xfan/forums/s...threadid=12267

I've ensured that all templates used are listed, and it's still coming up as 67 queries.

Any ideas?

NTLDR 10-25-2002 02:56 PM

Only thing I can think of that could be buming up there queries is the flags hack, I've never used it so I can't say and without having a list of the queries that are being run on your site its hard to tell ;)

X-Fan 10-25-2002 03:00 PM

I've had the flags hack installed for a while now, and it hasn't had a noticeable impact on query totals.

However, the expand/contract posts hack appears to be using a sizeable chunk, as I've only just recently installed that.

NTLDR 10-25-2002 03:03 PM

I never had any problems with that hack when I had it installed.

The best option is this:

Note leave this line in congif.php for as little time as posible, it will compromise security.

Add to config.php $debug=1;

Then visit:

http://x-mencomics.com/xfan/forums/s...&showqueries=1

This will give a list of queries that are being performed on showthread and you can look for a whole batch that are similar, or you could save the HTML and post it here.

Remember to remove $debug=1; from config.php

X-Fan 10-25-2002 03:19 PM

Okay, this is getting really weird. I just had to edit the first post of the thread I linked to in my previous post above, and now it's up to 74 queries!

How's that possible? (PHP newbie here, if you couldn't guess! :p )

EDIT: Okay, I did the debug, and I'm seeing numerous copies of this one query:

PHP Code:

QuerySELECT usergroupid FROM user WHERE userid=

userid 1 is my userid at my site, and that's showing up around 15 times on that debug list. Is it meant to be that many?

NTLDR 10-25-2002 03:23 PM

No, that should be there only once IMO, check in showthread.php and in the getpostbit(); function in admin/functions.php and see if you have that query in there multiple times:

[sql]SELECT usergroupid FROM user WHERE userid=[/sql]

^^ it will contain that part.

NTLDR 10-25-2002 03:24 PM

Also, I don't no if any extra stuff appears if you logged in or not, here what I get:

Page generated in 1.02646506 seconds (83.87% PHP - 16.13% MySQL) with 69 queries.

Which is still way too high.

X-Fan 10-25-2002 10:46 PM

I just checked both showthread.php and admin/functions.php, and that SELECT query only appears once in admin/functions.php under the "Start getpermissions" section.

But that query is still being called numerous times on the showthread page.

Any ideas why?

Erwin 10-25-2002 11:30 PM

67 queries is shocking. No wonder your server is choking.

You've got a hack in your functions.php that finds out if a post is by you (userid=1) and then if it is you have ads under your username in the postbit.

That's the hack that's the reason for your userid being queried like that possibly - the flags hack does not add more queries at all.

X-Fan 10-25-2002 11:34 PM

Erwin, there's nothing in functions.php that checks for userid=1 specifically. There's only that one line that selects the usergroupid from the user table, and I'm assuming that's to check whether the user has permissions to view the thread.


All times are GMT. The time now is 04:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01523 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete