PDA

View Full Version : SQL Query on big forum: Could this cause the server to crash?


magicfox
04-25-2006, 11:11 AM
Hi there!

I want to use the "PluhNews" news grabber for a updated version of my general homepage to include the latest 8 threads from my vBulletin 2.3.0 forum directly on the main page, but I'm afraid the resulting server load could be too big, when "PluhNews" performs the collection of the latest threads.

"PluhNews" uses the following SQL query to grab the latest entries from the database:

SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid IN ("8,9,10,11,12,13,14,15,16,17,18,24,33") ORDER BY threadid DESC LIMIT 8
8,9,10 and so on are the forums which should be "scanned".

So each time a user calls my homepage, this query will be started. My forum is pretty big (~35.000 postings each month, ~300 users at once online, whole database ~700 MB) and I'm not sure if the server could stand this query.

Since I'm not familiar with SQL at all my questions:

- Do you think this query could cause problems or is the query not server intensive at all?
- Is there a way to change to query for a lower impact on the server?

Thanks a lot!

Gio~Logist
04-25-2006, 05:52 PM
Hi there!

I want to use the "PluhNews" news grabber for a updated version of my general homepage to include the latest 8 threads from my vBulletin 2.3.0 forum directly on the main page, but I'm afraid the resulting server load could be too big, when "PluhNews" performs the collection of the latest threads.

"PluhNews" uses the following SQL query to grab the latest entries from the database:

SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid IN ("8,9,10,11,12,13,14,15,16,17,18,24,33") ORDER BY threadid DESC LIMIT 8
8,9,10 and so on are the forums which should be "scanned".

So each time a user calls my homepage, this query will be started. My forum is pretty big (~35.000 postings each month, ~300 users at once online, whole database ~700 MB) and I'm not sure if the server could stand this query.

Since I'm not familiar with SQL at all my questions:

- Do you think this query could cause problems or is the query not server intensive at all?
- Is there a way to change to query for a lower impact on the server?

Thanks a lot!

That query seems fine to me and does not look as if it would take a long time to generate.

magicfox
04-25-2006, 06:00 PM
Thanks for the reply, gio~logist!

Do you think the server can stand this query, even if called multiple times at once? When two, three or even more visitors at once are visiting my homepage and forcing the query to catch the informations from the database?

I wonder because my database is ~700 MB big and the query needs to search the whole database, or not?

Paul M
04-25-2006, 06:04 PM
The normal operation of vb runs more intensive queries than that. I see no reason to worry.

filburt1
04-25-2006, 09:29 PM
Don't use quotes in the IN clause.