Re: row read performance
- From: "joeNOSPAM@xxxxxxx" <joe.weinstein@xxxxxxxxx>
- Date: 28 Jan 2006 08:25:49 -0800
It depends on the DBMS and mode you're communicating with it. Some
DBMSes
only return one or a settable number of rows while 'next()ing' through
a
result set, and even the same DBMS may return all the rows before the
first next(), so even if you only read one row, the driver may have to
drain the
socket of all the data under-the-covers before it is usable in any
other way!
One of the basic tenets of DBMS application performance is to not
move the
data out of the DBMS unless you have to display it.
What is the ratio of wanted rows to DBMS contents? Can you devote 10
full minutes to pondering the idea of *not* retrieving all those rows
at one
time? What are they for? How often do they change? Can you cache the
unchanged data in client or middlespace, and only fetch rows whose
timestamp
indicate they have changed since you last cached them? These are some
ideas to ponder.
So, if you must do what you asked, find out how to specify your
result set
type (forward only, insensitive) and statement.setFetchSize() to a
reasonable
setting for your purpose.
Then do one query, select the columns you need from the table where key
IN
(1,2,3,...) Ie: one list, which if you can sort at the client, it
would be better.
What DBMS and driver are you using?
Joe Weinstein at BEA Systems
.
- Follow-Ups:
- Re: row read performance
- From: VisionSet
- Re: row read performance
- References:
- row read performance
- From: VisionSet
- row read performance
- Prev by Date: Re: Pointbase
- Next by Date: Re: row read performance
- Previous by thread: row read performance
- Next by thread: Re: row read performance
- Index(es):
Relevant Pages
|
|