The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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? |
#2
|
||||
|
||||
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
|
#3
|
||||
|
||||
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. |
#4
|
||||
|
||||
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 |
#5
|
||||
|
||||
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! ) EDIT: Okay, I did the debug, and I'm seeing numerous copies of this one query: PHP Code:
|
#6
|
||||
|
||||
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. |
#7
|
||||
|
||||
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. |
#8
|
||||
|
||||
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? |
#9
|
||||
|
||||
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. |
#10
|
||||
|
||||
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.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|