Notifications
Clear all

[3.3.1] EMERGENCY! Load Spikes causing 350,000 rows to be generated????

4 Posts
3 Users
0 Reactions
1,988 Views
(@dreamhowler)
Posts: 147
Estimable Member
Topic starter
 

I got this today, and I am totally worried! They want to disable my database because it is generating 350,000 load spikes! Can anyone help???? I am in a panic here!

Dreamy
http://rq.citadelofthewolf.com/index.php

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

Hello,

This is to inform you that your database (hp) is causing load spikes on the database server.

I noticed this query running:

User@Host: USERNAME[USERNAME] @ homer.dreamhost.com [IP Address]
# Query_time: 1  Lock_time: 0  Rows_sent: 30  Rows_examined: 356430
use hp;
SELECT count( stories.sid ) as stories, author.penname as penname,
author.uid as uid FROM hpfanfiction_authors as author LEFT JOIN
hpfanfiction_authorprefs AS ap ON author.uid = ap.uid LEFT JOIN
hpfanfiction_stories AS stories ON stories.validated > 0 AND
(FIND_IN_SET(author.uid, stories.coauthors) > 0 OR stories.uid =
author.uid)  GROUP BY author.uid ORDER BY author.penname LIMIT 0,30;

That's over 350,000 rows!

I do not want to disable your database, but if this is not fixed I may need to!


Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 16/01/2008 10:04 pm
(@tammy)
Posts: 2577
Member Moderator
 

Do a search on co-authors.  There's a post explaining how to disable co-authors and stop the problem.  A more permanent solution is going to require a lot of reworking on the script, but I am working on it.


 
Posted : 17/01/2008 12:33 am
(@dreamhowler)
Posts: 147
Estimable Member
Topic starter
 

I searched for it, and I can't seem to find it. The closest I found was something about slow databases and it didn't exactly say how to disable it as far as I can determine.

https://efiction.org/forums/index.php?topic=5697.msg30899

The fundamental problem here isn't the FIND_IN_SET.  It's that we're calculating the number of stories the person has authored on the fly.  Even if you moved the coauthors to a separate table, with a large number of stories and authors it's still going to be slow calculating those numbers.  The solution is going to be adding a new integer field to the _authorinfo table to keep a count of the stories they member has authored.

What exactly does that mean?

Also, is there a way to disable all co-author functions until your new upgrade? I don't have any on my site, so I don't really need it.


Current Version: 3.4.2
PHP 4
Mods: Challenges, Recommendations, Storyend, Display Word, Beta Reader, Bad Reviewer

 
Posted : 17/01/2008 1:02 am
(@itanshi)
Posts: 381
Reputable Member
 

Its in your admin section under settings > submission settings.


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 17/01/2008 11:26 am
Share: