List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:August 18 1999 7:10pm
Subject:Re: fetchall_arrayref
View as plain text  
At 11:56 AM -0700 8/18/99, Thimble Smith wrote:
>At 13:41, 19990818, Paul DuBois wrote:
>>> [ me saying fetchrow_arrayref is better than fetchall_arrayref ]
>>
>>Why is it better?  I don't think you get any memory savings by fetching
>>a row at a time and working with your data that way.  The MySQL DBD uses
>>mysql_store_result() by default, so it's fetching the entire result set
>>into memory anyway.  And you're not making an extra copy by using
>>fetchall_arrayref() since all you're getting back is a reference.
>
>Yep.  I bet you're right.  Anyway, if there is a difference it's probably
>not big enough to notice.

>At 13:41, 19990818, Paul DuBois wrote:
>>> [ me saying fetchrow_arrayref is better than fetchall_arrayref ]
>>
>>Why is it better?  I don't think you get any memory savings by fetching
>>a row at a time and working with your data that way.  The MySQL DBD uses
>>mysql_store_result() by default, so it's fetching the entire result set
>>into memory anyway.  And you're not making an extra copy by using
>>fetchall_arrayref() since all you're getting back is a reference.
>
>Yep.  I bet you're right.  Anyway, if there is a difference it's probably
>not big enough to notice.


Especially compared to the latency involved in sending the query and
retrieving the rows.  I can't imagine that the dereferencing time is
even in the same order of magnitude.

There's something to be said for processing data efficiently, but
in a client/server environment, network latency is bound to swamp
a lost of those efficiency considerations.

-- 
Paul DuBois, paul@stripped
Thread
fetchall_arrayrefFRed18 Aug
  • RE: fetchall_arrayrefDan Ray18 Aug
    • RE: fetchall_arrayrefPaul DuBois18 Aug
      • RE: fetchall_arrayrefDan Ray18 Aug
        • Re: fetchall_arrayrefThimble Smith18 Aug
          • Re: fetchall_arrayrefPaul DuBois18 Aug
            • Re: fetchall_arrayrefThimble Smith18 Aug
              • Re: fetchall_arrayrefPaul DuBois18 Aug
      • Re: fetchall_arrayrefScott Hess18 Aug
  • Re: fetchall_arrayreffelix k sheng18 Aug
RE: fetchall_arrayrefDarren L Sweeney18 Aug
Re: fetchall_arrayrefPaul DuBois18 Aug