optimisation in cursor
Matt S Trout [Fri, 3 Aug 2007 18:52:16 +0000 (18:52 +0000)]
Changes
lib/DBIx/Class/Storage/DBI/Cursor.pm

diff --git a/Changes b/Changes
index b86c2b5..8635a41 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,4 +1,7 @@
 Revision history for DBIx::Class
+
+        - optimisation in DBI::Cursor to check software_limit before falling
+          back to base Cursor->all
         - fix bug with create_multi not inserting non-storage objects
           (test and fix from davinchi)
         - DBIx::Class::AccessorGroup made empty subclass of
index e6ff5dd..426f72e 100644 (file)
@@ -124,7 +124,10 @@ sub _dbh_all {
 
 sub all {
   my ($self) = @_;
-  return $self->SUPER::all if $self->{attrs}{rows};
+  if ($self->{attrs}{software_limit}
+        && ($self->{attrs}{offset} || $self->{attrs}{rows})) {
+    return $self->SUPER::all;
+  }
   $self->{storage}->dbh_do($self->can('_dbh_all'), $self);
 }