<?xml version="1.0" encoding="windows-1252"?>
<node id="273966" title="Re: Speeding up the DBI" created="2003-07-14 09:16:21" updated="2005-07-07 14:25:47">
<type id="11">
note</type>
<author id="194920">
diotalevi</author>
<data>
<field name="doctext">
&lt;p&gt;I don't have time to comment just now but the comparison between the different fetch methods and data set size isn't all that appropriate for PostgreSQL. There you'd use ORDER BY/OFFSET/LIMIT instead of the $max_rows. You'd also contrive to use a cursor which means you'd probably eschew [cpan://DBI] and use [cpan://Pg] or [cpan://Pg::Simple]. That is, if you found yourself working with really large result sets.&lt;/p&gt;&lt;p&gt;The [cpan://DBD::Pg] driver always has PostgreSQL complete the entire SQL command and then copies the entire result over to perl. Trying to iterate with -&gt;fetch doesn't help with that - you'd need a cursor (which isn't supported under DBI) or to reduce the data size.&lt;/p&gt;&lt;p&gt;Anyone else care to follow up with some concrete advice? I've got to head off to work just now.&lt;/p&gt;</field>
<field name="root_node">
273952</field>
<field name="parent_node">
273952</field>
</data>
</node>
