Re: [GENERAL] BIG Data and Perl
От | Roderick A. Anderson |
---|---|
Тема | Re: [GENERAL] BIG Data and Perl |
Дата | |
Msg-id | Pine.LNX.4.04.9910150910280.18776-100000@asgard.altoplanos.net обсуждение исходный текст |
Ответ на | BIG Data and Perl (Andy Lewis <alewis@roundnoon.com>) |
Список | pgsql-general |
On Fri, 15 Oct 1999, Andy Lewis wrote: > -- cut -- > $result = $conn->exec("$query"); > > $ntuples = $result->ntuples; > print STDOUT "Total: $ntuples \n\n"; > > while ( @row = $result->fetchrow ) { > do some stuff here...ie, open file and read > } I've seen similar effects when working with arrays. I'm not sure since I'm still new to PostgreSQL but would a foreach loop work. foreach @row ( $result->fetchrow ) { @columns = @$row; } I seem to remember reading somewhere that foreach's are faster and more memory conservative. (Been reading too many perl books lately so I can't say where I saw this.) Rod -- Roderick A. Anderson raanders@altoplanos.net Altoplanos Information Systems, Inc. Voice: 208.765.6149 212 S. 11th Street, Suite 5 FAX: 208.664.5299 Coeur d'Alene, ID 83814
В списке pgsql-general по дате отправления: