in reply to building an HoAoH ... very badly
You are fetching the whole result set into a memory structure. In this case, you could use DBI's fetchall_arrayref or even selectall_arrayref methods. The latter combines prepare, bind, and fetch into one call:
The {Slice => {}} gives you a hashref for every row (default is arrayref).my $data = $conn->selectall_arrayref(q{ select season, episode, name from episodes where show = ? }, {Slice => {}}, 'Simpsons' );
|
|---|