Re: out of memory



Ron,

Thanks for the suggestions. But, wouldn't it just be better to switch back
to using fetchrow_array()? Is there any advantage to using bind_columns in
this case?

On 12/29/06, Ron Savage <ron@xxxxxxxxxxxxx> wrote:

On Fri, 29 Dec 2006 08:46:03 -0800, louis fridkis wrote:

Hi Louis

> Thanks for your reply's. No, I'm not insulted. This is a quick-and-
> dirty to generate some test data. But, I do appreciate the comments
> since I am eager to improve.

Glad you're taking it the right way!

> $rv = $cel_sth->bind_columns(\($elementresult_id, $element_id,
> $quantification_id, $signal));

Why can't you use @rowvalues here?

> while($cel_sth->fetch()){
> @rowvalues = ($elementresult_id, $element_id, $quantification_id,
> $signal); # # end # added & replaced #
> my $printstring= "insert into $table_name values("; foreach my
> $column (@rowvalues){ if (defined $column){ if($column =~

If you don't change the call to bind_columns(), why can't you use:
for my $column ($elementresult_id, $element_id,
$quantification_id, $signal)
here? That saves copying the info into @rowvalues.

> fetchrow_array(). I changed in the hopes that fetch() would work
> better. The reason I think it tries to hold all the rows in memory
> is because it works when the query in $sqlstring returns a small
> number of rows, but fails with the "out of memory" error when it
> returns a large number of rows.

That makes me think the problem really is you lack of RAM.
--
Cheers
Ron Savage, ron@xxxxxxxxxxxxx on 30/12/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company




--
Lou Fridkis
Human Genetics
57920


Relevant Pages

  • Re: out of memory
    ... dirty to generate some test data. ... since I am eager to improve. ... That saves copying the info into @rowvalues. ... The reason I think it tries to hold all the rows in memory ...
    (perl.dbi.users)
  • Re: out of memory
    ... Assuming you're using mysql, take a look at the mysql_use_result attribute. ... my @rowvalues; ... I guess the problem is it tries to hold all the rows in memory. ... Lou Fridkis ...
    (perl.dbi.users)
  • out of memory
    ... I am running out of memory when I try to select about 100K rows. ... my @rowvalues; ... foreach my $column { ... Lou Fridkis ...
    (perl.dbi.users)
  • Re: RFC: The future of Text::CSV_XS
    ... H.Merijn Brand wrote: ... quite easy to create yourself in a map construct; ... Every method call on every object in every program has the potential to use memory. ... Ron Savage ...
    (perl.dbi.users)