Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: benchmarking DBI bind columns vs. fetchrow_arrayref

by arturo (Vicar)
on Mar 20, 2001 at 19:33 UTC ( [id://65704]=note: print w/replies, xml ) Need Help??


in reply to benchmarking DBI bind columns vs. fetchrow_arrayref

bind_columns and fetchrow_arrayref do different things. You can, in fact, combine them, as it says right there in the DBI documentation:

`fetchrow_arrayref'
             $ary_ref = $sth->fetchrow_arrayref;
             $ary_ref = $sth->fetch;    # alias

           Fetches the next row of data and returns a reference
           to an array holding the field values.  Null fields are
           returned as `undef' values in the array.  This is the
           fastest way to fetch data, particularly if used with
           `$sth-'>`bind_columns'.

fetchall_arrayref determines how much data is fetched, and bind_columns affects how what is fetched ends up, so to speak.

I'm not sure what you mean by execute being 'the bottleneck', exactly; sure it might be where the lion's share of the processing time gets spent, but notice that you're using DBD::CSV, so the engine that's hiding all the complexity of CSV from you is working hard when you call that (it's turning CSV separated data into table rows). You'd see very different results if you used a DBMS like MySQL or Informix (etc.) here.

DBI just gives you a consistent *interface* to different data sources; what's going on under the hood with various data sources is going to be, in general, well, different.

Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://65704]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-03-28 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found