Aaron,
I assume the point is not in terms of what you might do with them *within
your program* - as you point out, you're almost always going to process them
row by row anyway, and that's a tiny percentage of processing. More
important (in terms of performance and related factors) is *how* you
retrieve them from the database - (very) roughly speaking, whether you
retrieve a set of records via SQL or a single record (either via SQL or
RLA), there is an equivalent cost. It's slightly more to retrieve a set of
records than it is to retrieve a single record, but not much so, and
*way*less than the cumulative cost of retrieving the records
individually...
In terms of relative performance cost, it's (again, very, very, very
roughly):
Retrieve a single record via RLA: 1
Retrieve a single record via SQL: 1.2
Retrieve a block of 10 records via SQL using a cursor: 3
Retrieve 10 records individually via RLA: 10
Retrieve 10 records individually via SQL: 12
Therefore, if you know that you're going to need a block of records, it
makes sense to pay a one-off price up front to get them all, rather than
retrieve them individually, using either SQL or RLA. the only time
individual retreival makes sense is if you only need a few random records
(i.e. CHAIN), at which point RLA might make sense.
The numbers above are definitely for illustration purposes only. They're
extremely rough and based on *way* out of date data....
Rory
On Thu, Nov 18, 2010 at 1:18 PM, Aaron Bartell <aaronbartell@xxxxxxxxx>wrote:
Now you have me curious. What do you do with a set of records as a whole
vs. process them row by row? It would seem to me that at some point a row
needs to be processed by iteself.
Aaron Bartell
www.MowYourLawn.com/blog
www.OpenRPGUI.com
www.SoftwareSavesLives.com
As an Amazon Associate we earn from qualifying purchases.