Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: fetch row or fetchall

by steves (Curate)
on Nov 09, 2004 at 20:46 UTC ( #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
Node Status?
node history
Node Type: note [id://406493]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2016-10-01 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (574 votes). Check out past polls.