try this:

my $row;
print "<table>";
while($row = $dbh->fetch()) {
        print Tr([td([@$row[1..18]])]);
}
print "</table>";

This only pulls a database resultset row into memory when you need.  In your
earlier example you pull everything into memory first and then print it out.
This can be quite inefficient.  I'm not sure how much this will speed up
your load time, if any, but it theoretically should work.

Brad Handy

--www.jack-of-all-trades.net
[EMAIL PROTECTED]


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 20, 2001 7:07 AM
> To: [EMAIL PROTECTED]
> Subject: Table display speed: can be improved?
>
>
> Hi,
>
>       I have to display some tables with several hundreds of rows in one
> page. It takes more than 30s for 150 rows with that code:
>
> $recordset = $dbh->selectall_arrayref($query, undef);
>
> print "<table>";
> foreach $row(@$recordset)
>

>                       print Tr([td([@$row[1..18]])]);
>               }
> print "</table>";
>
>
> Has anyone a clue how to improve that to some seconds?
>
> Thanks,
>
> Yann
>
>
> ===========================================================
> De verzonden informatie is uitsluitend bestemd voor de geadresseerde
> natuurlijke persoon of rechtspersoon en bevat mogelijk
> vertrouwelijke en/of
> geprivilegeerde gegevens. Met uitzondering van de geadresseerde persoon is
> het niet toegestaan de informatie openbaar te maken, te kopiëren, te
> verspreiden of anderszins actie te ondernemen op basis van de informatie.
> Indien u de informatie abusievelijk heeft ontvangen, neem dan
> contact op met
> de afzender en verwijder de informatie uit alle computers. Dutchtone staat
> niet in voor de juiste en complete verzending van de informatie,
> noch is zij
> aansprakelijk voor de vertraagde ontvangst hiervan.
>
> The information transmitted is intended exclusively for the
> person or entity
> to which it is addressed and may contain confidential and/or privileged
> material. Any disclosure, copying, distribution or other action
> based upon
> the information by persons or entities other than the intended
> recipient is
> prohibited. If you receive this information in error, please contact the
> sender and delete the material from any and all computers. Dutchtone does
> not warrant a proper and complete transmission of this
> information, nor does
> it accept liability for any delays.
> ===========================================================
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to