My question is the following - does this execute the query and store everything
   in the array prior to printing or does it grab and print one row and at a time
    - which is what I am thinking it does?


Yup -- it executes the query in the database (Update just read Zaxo's reply--y, i guess i'm thinking of RDBMS that support the row-at-a-time fetching) and the "fetch" calls just bring back one row at a time, and you're also right that this (all the fetch* methods) prevents your code from loading the entire result in memory at once. Of course, there are times where loading all-at-once is just fine and that's that the select* (selectrow_*, selectall_*, selectcol_*) DBI functions are for.

In reply to Re: fetchrow_array memory usage by davidrw
in thread fetchrow_array memory usage by ctaustin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.