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
Return to the default flat view Create a new topic Submit Reply
Suggestion for the "rebuild search index" page [message #163936] Mon, 13 December 2010 06:34 Go to previous message
mguillaume is currently offline  mguillaume   France
Messages: 13
Registered: December 2010
Karma:
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);

[Message index]
 
Read Message
Read Message
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: Sun Nov 24 07:09:43 GMT 2024

Total time taken to generate the page: 0.04031 seconds