1 package FS::Cron::vacuum;
3 use vars qw( @ISA @EXPORT_OK);
5 use FS::UID qw(driver_name dbh);
6 use FS::Schema qw(dbdef);
9 @EXPORT_OK = qw( vacuum );
13 if ( driver_name eq 'Pg' ) {
14 dbh->{AutoCommit} = 1; #so we can vacuum
15 foreach my $table ( dbdef->tables ) {
16 my $sth = dbh->prepare("VACUUM ANALYZE $table") or die dbh->errstr;
17 $sth->execute or die $sth->errstr;