Enhancement of Forum Prune Function when is too Slow
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexCPG-BB (forum)
Author Message
Aforo
I18N / L10N Lead Dev


Joined: Dec 27, 2007
Posts: 146

PostPost subject: Enhancement of Forum Prune Function when is too Slow
Posted: Thu Mar 26, 2009 7:20 pm
Reply with quote

I had problems with forum prune in a big forum (near 100.000 topics).

It was too slow and more of the times prune doesn't work and I had the error of "too many conections"... and database was stoped several times. This situation was repeated some times, even when we work at low traffic time without good result.

I resolved it changing the SQL query.

includes/phpBB/prune.php around 35 line:

Quote:

//
// Those without polls and announcements ... unless told otherwise!
//
//$sql = "SELECT t.topic_id FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
// WHERE t.forum_id = $forum_id
// $prune_all
// AND ( p.post_id = t.topic_last_post_id OR t.topic_last_post_id = 0 )";

$sql = "SELECT t.topic_id FROM " . POSTS_TABLE . " p LEFT JOIN " . TOPICS_TABLE . " t ON p.post_id = t.topic_last_post_id
WHERE t.forum_id = $forum_id $prune_all ";

I tested it and near 100 times more quick. Shocked

_________________
Aforo - Google Earth - WebNaranja - DFcms.es

Aforo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Centos 5/Apache 2.2.3/MySQL:5.0.45/PHP:5.2.10 /9.2
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexCPG-BB (forum) All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.3072 seconds with 16 DB Queries in 0.2009 seconds
Memory Usage: 2.84 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy