Thread Performanzproblem (DBIx::Class + mehrere Tabellen)
(6 answers)
Opened by pktm at 2009-02-13 15:01
Wenn es Dir nur um den 1. Eintrag geht, dann nimm besser first statt slice:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 #!/usr/bin/perl use strict; use warnings; use Local::DBIC_Schema; use Benchmark qw(cmpthese); my $schema = Local::DBIC_Schema->connect( 'DBI:SQLite:pktm' ); cmpthese( 100_000, { first => sub { my ($ding) = $schema->resultset('T')->search( undef, { order_by => 'testid DESC', } )->first; }, slicer => sub { my ($ding2) = $schema->resultset('T')->search( undef, { order_by => 'testid DESC', } )->slice(0,1); }, } ); OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/) -- Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html Perl-Entwicklung: http://perl-services.de/ |