Gentlemen, if your personal Mediawiki wiki has been around since early
2007, you might want to clean out the thousands of Mediawiki:
namespace rows that were left in the database by
maintenance/deleteDefaultMessages.php . Wouldn't it make you feel good
to clean out thousands of wasted rows, leaving behind e.g., on a small
wiki, perhaps just a few hundred rows that are actually related to us?

I don't know why the design decision was made to just leave those
Mediawiki: namespace items sitting in the archive and text tables. But
OK, we proceed to clean them out by hand. I hope I got this right:

$ mysqlshow --count myDatabase > before.txt
$ mysql myDatabase
SELECT COUNT(*) FROM archive WHERE ar_namespace = 8 AND ar_user_text = 
'MediaWiki default';
COUNT(*)
1518
DELETE FROM archive WHERE ar_namespace = 8 AND ar_user_text = 'MediaWiki 
default';
$ php purgeOldText.php --purge
Purge Old Text

Searching for active text records in revisions table...done.
Searching for active text records in archive table...done.
Searching for inactive text records...done.
1518 inactive items found.
Deleting...done.
$ mysql myDatabase
SELECT COUNT(*) FROM logging WHERE log_comment = 'No longer required' AND 
log_namespace = 8;
COUNT(*)
1510
SELECT MIN(log_timestamp),MAX(log_timestamp) FROM logging WHERE log_comment = 
'No longer required' AND log_namespace = 8;
MIN(log_timestamp)      MAX(log_timestamp)
20070226185326  20070226194040
DELETE FROM logging WHERE log_comment = 'No longer required' AND log_namespace 
= 8;
$ mysqlshow --count myDatabase|diff before.txt -|sed '/|/!d'
< | archive           |       15 |       2206 |
> | archive           |       15 |        688 |
< | logging           |       10 |       2597 |
> | logging           |       10 |       1087 |
< | text              |        3 |       4466 |
> | text              |        3 |       2948 |

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to