in reply to Reading (the same) data in different ways & memory usage

The first difference I see is that selectall_arrayref returns an array refs of array refs, whereas your homemade code seems to work with hash references. So maybe it's not the same size because the data structures are quite different?

$ perl -MDevel::Size=total_size -wE 'say total_size [1, 2, 3, 4]' 200 $ perl -MDevel::Size=total_size -wE 'say total_size { foo => 1, bar => + 2, baz => 3, blubb => 4}' 382

Replies are listed 'Best First'.
Re^2: Reading (the same) data in different ways & memory usage
by Neighbour (Friar) on Apr 19, 2011 at 12:44 UTC
    You can persuade selectall_arrayref to return an arrayref of hashrefs using the { Slice => {} } trick as described in the DBI manual.

    (edit) selectall_arrayref returns an arrayref, not an array :)