theres no 'optimise database' query, if thats what you mean.
one way you could achieve it easily tho, would be to return all the tables in a given database to an array, and run that statement for each of the array elements (tables).
EDIT
just like installers already done... lol