Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: fetch row or fetchall

by steves (Curate)
on Nov 09, 2004 at 20:46 UTC ( [id://406493]=note: print w/replies, xml ) Need Help??


in reply to fetch row or fetchall

You can still count the rows and only use the first 100: your loop could keep the first 100 but continue counting until fetching is complete. It's about the same as fetching all of them using a DBI fetchall call, but fetching would probably (but not necessarily depending on the underlying database driver) use more memory in your application.

Replies are listed 'Best First'.
Re^2: fetch row or fetchall
by pg (Canon) on Nov 09, 2004 at 21:08 UTC
    "your loop could keep the first 100 but continue counting until fetching is complete"

    I would rather do a seperate query for count(), for performance. Although you are skipping, not using the fetch result, they still get transferred across, and waste band width.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-04-19 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found