The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

<!--  Presentation generated by Internet Assistant for Microsoft PowerPoint 97 -->

<HTML>
<HEAD>

<meta name="GENERATOR" content="Microsoft Internet Assistant for Microsoft PowerPoint 97">
 <TITLE>Do more with less!</TITLE> 
</HEAD>

<BODY     >

<CENTER>
<TABLE WIDTH=100%> 
     <TR> <TD WIDTH=100% ALIGN=CENTER>
         <A HREF="sld001.htm">First</A>&nbsp;&nbsp;
         <A HREF="sld018.htm">Previous</A>&nbsp;&nbsp;
         <A HREF="sld020.htm">Next</A>&nbsp;&nbsp;
         <A HREF="sld102.htm">Last</A>&nbsp;&nbsp;
&nbsp;&nbsp;         <A HREF="index.htm">Index</A>&nbsp;&nbsp;
         <A HREF="dbi.perl.org">Home</A>&nbsp;&nbsp;
         <A HREF="tsld019.htm">Text</A>&nbsp;&nbsp;
     </TD> </TR>
     <TR> <TD WIDTH=100% ALIGN=CENTER>
         <IMG SRC="img019.gif" usemap="#Objmap" WIDTH=800 HEIGHT=600 BORDER=0>
     </TD> </TR>
</TABLE>
<P>Slide 19 of 102</P>
</CENTER>
<!-- <UL>
<H2>Do more with less!</H2>
</UL></P>
<P><UL>
<LI><H2>Reduce the number of DBI calls
</H2>
<UL>
<LI>The DBI is fast -- but it isn’t free!
<LI>
</UL></UL><UL>
<LI><H2>Using RaiseError is faster than checking return values
</H2>
<UL>
<LI>and much faster than checking $DBI::err or $h-&#062err
<LI>
</UL></UL><UL>
<LI><H2>Using fetchall_arrayref (or selectall_arrayref) is now much faster
</H2>
<UL>
<LI>if using a driver extension compiled with the DBI’s Driver.xst wrapper (most are) 
<LI>because the loop is written in C and doesn’t make a method call per row
<LI>
</UL></UL><UL>
<LI><H2>Using fetchall_arrayref is possible for very large result sets
</H2>
<UL>
<LI>new $max_rows parameter limits rows returned (and memory consumed)
<LI>just add an outer loop to process the results in ‘batches’, or do it in-line:
</UL>$row = shift(@$cache)
<BR>		|| shift @{$cache=$sth-&#062fetchall_arrayref(undef, 1000)};</UL></P>
<P>  -->
</Body>
</HTML>