FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Suggestion for the "rebuild search index" page
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Suggestion for the "rebuild search index" page [message #163936] Mon, 13 December 2010 06:34 Go to next message
mguillaume is currently offline  mguillaume   France
Messages: 13
Registered: December 2010
Karma: 0
Junior Member
When rebuilding the search index on a forum with 13000ish messages, I run out of memory in the database.
I suggest replacing the commit frenquency to a fixed number of messages rather than total/10 (assuming that's what the original code does).

Note: the "+1" is only so the progress doesn't get a divide by zero.


--- www-old/adm/indexdb.php	2010-12-13 10:59:22.000000000 +0100
+++ www/adm/indexdb.php	2010-12-13 10:59:32.000000000 +0100
@@ -68,7 +68,7 @@
 		while ($r = db_rowarr($c)) {
 			index_text($r[1], read_msg_body($r[2], $r[3], $r[4]), $r[0]);
 
-			if ($i && !($i % ceil($i_count/10))) {
+			if ((($i+1) % 100) == 0) {
 				/* Commit and re-acquire locks. */
 				db_unlock();
 				eta_calc($start_time, $i, $i_count);

Re: Suggestion for the "rebuild search index" page [message #163945 is a reply to message #163936] Tue, 14 December 2010 10:48 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Yes, we need to apply this to indexdb.php and compact.php.

Thanks for the heads up.

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Mini-patch to better deal with mailing-list subject lines
Next Topic: Database host:port support
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 18:49:35 GMT 2024

Total time taken to generate the page: 0.02322 seconds