[Dbix-class] Running $rs->count() on full resultset?

Matt S Trout dbix-class at trout.me.uk
Mon Apr 10 15:52:49 CEST 2006


Jesse Sheidlower wrote:
> I'm dynamically constructing my $rs search statements, and including
> "page" and "rows" values in my attribute hash, for paged results.

Don't do it that way.

my $rs = $schema->resultset("CD")->search(...);

my $first_page_rs = $rs->page(1);

my $total_results = $rs->count;

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list