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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
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 01:34 Go to next message
mguillaume is currently offline  mguillaume   France
Messages: 13
Registered: December 2010
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 05:48 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Yes, we need to apply this to indexdb.php and compact.php.

Thanks for the heads up.

Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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 Oct 21 11:36:38 EDT 2017

Total time taken to generate the page: 0.00598 seconds