Página 1 de 1

fallos en prune.php

Publicado: 03 Abr 2004, 06:24
por Danny
Bueno por fin encontrí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?© la solucií?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?³n, normalmente lo que hago en mi foro es cuando llego a 300.000 mensajes borrarlos hasta dejarlo en 100.000, normalmente la funcií?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?³n prune dle foro, cuando no dí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?¡ timeout, acaba siendo tan grande que te obliga a hacer el prune de 5 en 5 dí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?­as y cosas por el estilo.
Pero por fin econtrí?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?© la solucií?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?³n mientras creaba unos í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?Â?í?­ndices nuevos en las tablas.
He podido borrar 200.000 mensajes de un plumazo.

abrir /includes/prune.php

y donde pone:

$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 )";

Sustituir por
$sql = "SELECT t.topic_id
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
WHERE t.forum_id = $forum_id
$prune_all
AND p.topic_id = t.topic_id AND
( p.post_id = t.topic_last_post_id OR t.topic_last_post_id = 0 )";