Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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?
[james28909]: nope, i havent written any article about it yet. maybe in the future sometime once i have time for more testing

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2017-05-01 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (544 votes). Check out past polls.