Author: timbo
Date: Tue Mar 16 01:52:09 2004
New Revision: 233

Modified:
   dbi/trunk/DBI.pm
   dbi/trunk/ToDo
Log:
Minor tweaks


Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm    (original)
+++ dbi/trunk/DBI.pm    Tue Mar 16 01:52:09 2004
@@ -638,6 +638,12 @@
        # if we've been subclassed then let the subclass know that we're connected
        $dbh->connected($dsn, $user, $pass, $attr) if ref $dbh ne 'DBI::db';
 
+       # if the caller has provided a callback then call it
+       # especially useful with connect_cached() XXX not enabled/tested/documented
+       if (0 && $dbh && my $oc = $dbh->{OnConnect}) { # XXX
+           $oc->($dbh, $dsn, $user, $auth, $attr) if ref $oc eq 'CODE';
+       }
+
        DBI->trace_msg("    <- connect= $dbh\n") if $DBI::dbi_debug;
 
        return $dbh;
@@ -5200,7 +5206,14 @@
     ...
   }
 
-That is the fastest way to fetch and process lots of rows using the DBI.
+That can be the fastest way to fetch and process lots of rows using the DBI,
+but it depends on the relative cost of method calls vs memory allocation.
+
+A standard C<while> loop with column binding is often faster because
+the cost of allocating memory for the batch of rows is greater than
+the saving by reducing method calls. It's possible that the DBI may
+provide a way to reuse the memory of a previous batch in future, which
+would then shift the balance back towards fetchall_arrayref().
 
 
 =item C<fetchall_hashref>

Modified: dbi/trunk/ToDo
==============================================================================
--- dbi/trunk/ToDo      (original)
+++ dbi/trunk/ToDo      Tue Mar 16 01:52:09 2004
@@ -148,17 +148,14 @@
 mx and pr wouldn't both apply to the same test
 
 Add data structure describing attributes
-Use the data structure to replace similar data in Proxy and PurePerl code
+Use the data structure to replace similar data in Proxy, Multiplex,
+PurePerl and other places.
+
+Add OnConnect attribute to connect() esp. for connect_cached()
 
 Remove _not_impl. Alias debug to trace in DBI::(dr/db/st) ad remove
 debug() method from internals.
 
-Mechanism to 'unset' the keep_error flag for the current call, which
-could then be used by FETCH when appropriate. Or, better:
-New ima flags: CLEAR_ERR (on entry), CHECK_ERR (on exit), CHECK_NEW_ERR
-(check if error count has been incremented by set_err).
-Then FETCH would have just CHECK_NEW_ERR.
-
 Macro to get new statement handle for XS code
 
 Trace to tied file handle.

Reply via email to