Status
Not open for further replies.
hey

I have a MAJOR problem....

app. 160 times a day i certain query is being called and it returns more than 500.000 results each time... its literally killing my entire DB - everything STOPS meanwhile... i have an avg of 59 sec. 160 times a day where the forum is useless..

i need to know right now how to fix this, because i am loosing users because of the speed... noone wants to wait an avg of 59 secs to post or to do anything else...

i turned on the slow Q log to get the exact query that is causing my problem.... please tell me how to fix my problem!!!



heres the result of the slow query log

# Query 1: 0.00 QPS, 0.08x concurrency, ID 0x043CEB5223529471 at byte 3885737
# This item is included in the report because it matches --limit.
# Scores: Apdex = 0.00 [1.0]*, V/M = 44.22
# Query_time sparkline: | ^|
# Time range: 2011-09-12 15:58:30 to 2011-09-13 08:12:25
# Attribute pct total min max avg 95% stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count 42 79
# Exec time 68 4561s 11s 229s 58s 130s 51s 32s
# Lock time 2 16ms 0 16ms 197us 0 2ms 0
# Rows sent 2 1.53k 14 20 19.86 19.46 0.83 19.46
# Rows examine 91 227.47M 1.27M 3.05M 2.88M 3.03M 311.82k 3.03M
# Query size 1 76.07k 986 986 986 986 0 986
# String:
# Databases kattegale
# Hosts dumpe.wns.dk
# Query_time distribution
# 1us
# 10us
# 100us
# 1ms
# 10ms
# 100ms
# 1s
# 10s+ ################################################################
# Tables
# SHOW TABLE STATUS FROM `kattegale` LIKE 'vb_dbtech_thanks_entry'\G
# SHOW CREATE TABLE `kattegale`.`vb_dbtech_thanks_entry`\G
# SHOW TABLE STATUS FROM `kattegale` LIKE 'vb_user'\G
# SHOW CREATE TABLE `kattegale`.`vb_user`\G
# SHOW TABLE STATUS FROM `kattegale` LIKE 'vb_post'\G
# SHOW CREATE TABLE `kattegale`.`vb_post`\G
# SHOW TABLE STATUS FROM `kattegale` LIKE 'vb_thread'\G
# SHOW CREATE TABLE `kattegale`.`vb_thread`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT
post.postid,
post.title AS posttitle,
thread.title AS threadtitle,
thread.title AS title,
thread.threadid,
entry.varname,
entry.dateline,
entry.userid,
entry.receiveduserid,
user.username,
user.usergroupid,
user.infractiongroupid,
user.displaygroupid,
receiveduser.username AS receivedusername,
receiveduser.usergroupid AS receivedusergroupid,
receiveduser.infractiongroupid AS receivedinfractiongroupid,
receiveduser.displaygroupid AS receiveddisplaygroupid
FROM vb_dbtech_thanks_entry AS entry
LEFT JOIN vb_user AS user USING(userid)
LEFT JOIN vb_user AS receiveduser ON(receiveduser.userid = entry.receiveduserid)
LEFT JOIN vb_post AS post ON(post.postid = entry.contentid)
LEFT JOIN vb_thread AS thread ON(thread.threadid = post.threadid)

WHERE thread.forumid IN(46,47,48,6,23,19,50,17,16,20,8,52,24,53,7,26,27,33,34,39,36,5,40,15,28,10,12,29,30,35,3,14,61,0)

ORDER BY entry.dateline DESC, entry.userid
LIMIT 515240, 20\G
 
Unfortunately I don't know of any way to further optimise that query :(

I'll look into it as soon as I'm able, but for now you'll have to disable the mod until we can work this out (if at all).
 
Unfortunately I don't know of any way to further optimise that query :(

I'll look into it as soon as I'm able, but for now you'll have to disable the mod until we can work this out (if at all).

ok ill disable the whole thing - my users will hate me :( never has a feature been more popular... 1 mio thanks in little over a year :)

its a GREAT feature - i would hate to loose it
 
Did the speed issues just start recently? If so did you add any other mods before the issue appeared?
 
What are the specs on your current server setup?

Did you contact your host, and ask them if their is anything they can do?
 
Try the following:
Code:
ALTER TABLE dbtech_thanks_entry ADD INDEX ( `dateline` )

Remember to add your table prefix if you use any.

Then, put this file in /dbtech/thanks/hooks and tell me if that works better for you: http://dl.dropbox.com/u/13049666/showthread_query.php


EDIT: Could you please upgrade to the latest version as well? If this ends up fixing it, I'll be releasing a new version, and your old version is no longer supported :)
 
What are the specs on your current server setup?

Did you contact your host, and ask them if their is anything they can do?

i did contact them - and they have no errors and no lags on their part - and the slow query log show that the error is sole connected to this specific query.. and it corresponds with the error reporting i have recieved from my users

set up is following

Serverspace i MB Unlimited
Trafic Free
Pop3 / IMAP Unlimited
WebMail Yes
POP3/IMAP/SMTP Yes
Domæner 10 stk3
Subdomæne4 Unlimited
Alias Unlimited
PHP4 / 5 By choice
ASP Yes
ASP.NET 4.0
MySQL 4 / 5 20
msAccess Yes
msSQL 6
FTP kontoer Unlimited
Virus & Spamfilter yes
Servertype Windows 08

Try the following:
Code:
ALTER TABLE dbtech_thanks_entry ADD INDEX ( `dateline` )

Remember to add your table prefix if you use any.

Then, put this file in /dbtech/thanks/hooks and tell me if that works better for you: http://dl.dropbox.com/u/13049666/showthread_query.php


EDIT: Could you please upgrade to the latest version as well? If this ends up fixing it, I'll be releasing a new version, and your old version is no longer supported :)

shall i upgrade and then try adding the file or just adding the file ?
 
You can upgrade first, just so the upgrade doesn't overwrite the changes later in case you decide to update before I release the new version :)
 
i have upgraded to 1.1.9 - seemingly without prroblems

i have added the index

and i have overwritten the swowquery file...

but my thanks does not show in the forum ? - so no buttons to press
 
You'd obviously need to re-enable the product in order to test whether it works :)

hahaha - that thought did actually occur :) and i found the error also - it was my template :)

ill give it a try over the next few hours and see if the index AND the new file have made a difference

what was the purpose of the dateline index?
 
Along with the file changes, potentially reduce the number of rows scanned when running the query you posted.
 
i have upgraded to 1.1.9

i have changed the file you gave me...

the problem was solved for 12 hours... now its back - just as bad

SELECT
post.postid,
post.title AS posttitle,
thread.title AS threadtitle,
thread.title AS title,
thread.threadid,
entry.varname,
entry.dateline,
entry.userid,
entry.receiveduserid,
user.username,
user.usergroupid,
user.membergroupids,
user.infractiongroupid,
user.displaygroupid,
receiveduser.username AS receivedusername,
receiveduser.usergroupid AS receivedusergroupid,
receiveduser.membergroupids AS receivedmembergroupids,
receiveduser.infractiongroupid AS receivedinfractiongroupid,
receiveduser.displaygroupid AS receiveddisplaygroupid

FROM vb_dbtech_thanks_entry AS entry
LEFT JOIN vb_user AS user USING(userid)
LEFT JOIN vb_user AS receiveduser ON(receiveduser.userid = entry.receiveduserid)
LEFT JOIN vb_post AS post ON(post.postid = entry.contentid)
LEFT JOIN vb_thread AS thread ON(thread.threadid = post.threadid)

WHERE thread.forumid IN(46,47,48,6,23,19,50,17,16,20,8,52,24,53,7,26,27,33,34,39,36,5,40,15,28,10,12,29,30,35,3,14,61,0)

ORDER BY entry.dateline DESC, entry.userid
LIMIT 375240, 20



2 min average to run this... and theres table lock each time.... its killing the forum!!

help!!
 
Re-download the files from your Customer Area and re-upload them (no need to re-import XML file) - I updated a couple files that may help with this.
 
It didnt work - actually it upped the avg downtime to 3 min table lock each time it ran...

this is really really bad... now i have had to deactivate the hole application :( im only alive right now because my users are to poor to hire a mercenary...

would either of you like to take a look directly in the DB ? see what is going on while its operating ?


please help ... i really really need this working..
 
Last edited:
Status
Not open for further replies.

Legacy Advanced Post Thanks / Like

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,033
Customer rating
5.00 star(s) 1 ratings
Back
Top