On Tue, 2010-01-26 at 19:51 +0100, Bernhard Graf wrote:
> Kiffin Gish schrieb:
>
> > The lazy man's way out is:
> >
> > use DateTime;
> > use DateTime::Duration;
> >
> > my @users = $rs->search({state=>$state});
> > for my $user (@users) {
> > my $duration = DateTime::Duration->new(DateTime->now -
> > $user->last_modified);
> > $user->delete if ($duration->seconds > $limit);
> > }
> >
> > Probably more generic rather than hard-coding SQL stuff.
>
> Try this on a dataset with a million rows, please.
>
> L8er ;*)
>
> Bernhard Graf
Very true, but there must be better ways to do this than the reactions
so far.
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]