Manual:DeleteOldRevisions.php

A script.

According to its source code, what it does is to: "Delete old (non-current) revisions from the database"

(note that this will probably delete page histories, and if you run a GFDL wiki you need to be aware that GFDL wants you to keep histories, IANAL etc)