* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-require('./connect.db.inc.php');
+require './connect.db.inc.php';
-ini_set('memory_limit', "16M");
+ini_set('memory_limit', '16M');
$globals->debug = 0; // Do not store backtraces
$res = XDB::iterRow('SELECT pid
FROM profiles');
$i = 0;
$n = $res->total();
-while ($pid = $res->next()->fetchOneCell()) {
- Profile::rebuildSearchTokens($pid);
- printf("\r%u / %u", ++$i, $n);
+$pids = array();
+while ($pid = $res->next()) {
+ $pids[] = intval($pid[0]);
+ ++$i;
+ if (count($pids) == 100) {
+ Profile::rebuildSearchTokens($pids);
+ printf("\r%u / %u", $i, $n);
+ $pids = array();
+ }
+}
+if (count($pids) > 0) {
+ Profile::rebuildSearchTokens($pids);
+ printf("\r%u / %u", $i, $n);
}
print "done\n";