Re: row read performance



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

.



Relevant Pages

  • Re: choices regarding where to place code - in the database or middletier
    ... > from selling that middle tier but I completely disagree. ... server is not a thin client. ... I do believe that no bytes should leave the DBMS ... so it queried the DBMS for a list of the countries in Europe hundreds of times ...
    (comp.lang.java.databases)
  • Re: choices regarding where to place code - in the database or middletier
    ... > from selling that middle tier but I completely disagree. ... server is not a thin client. ... I do believe that no bytes should leave the DBMS ... so it queried the DBMS for a list of the countries in Europe hundreds of times ...
    (comp.lang.java.programmer)
  • Re: Size matters to some
    ... specified to the DBMS tools with a maxlen specification, ... database does, without the maxlen specification to the DBMS. ... logical size limitations in the client code. ... something into the framework to prevent that sort of thing from being ...
    (comp.databases.pick)
  • Re: What is the logic of storing XML in a Database?
    ... The receiver of some EDI information is simply a ... a given piece of client software is embedded in that client. ... When it connects with the dbms, it tell the dbms the schema ...
    (comp.databases.theory)
  • Re: Is there an obvious way to do this in python?
    ... | definitions) into the client that is installed on all user stations. ... | privilege table from the DBMS. ... This privilege table is essential a long ... | client does a log-off of the application server, ...
    (comp.lang.python)