Syntax could probably be cleaner but for the logs I have left it now as:
$sql = "TRUNCATE TABLE `ubbt_ADMIN_LOG`";
$sql2 = "TRUNCATE TABLE `ubbt_REFERER_LOG`";
$dbh->do_query($sql);
$dbh->do_query($sql2);
Then I set the cache to like every 3 days.
Works perfect as is.