Re: resultset - performance difference - get(1) vs get("col_name")
Lothar Kimmeringer wrote:
Tim B wrote:
I'm looking for performance comparisons between rs.get(1) vs
rs.get("col_name") where rs is a java.sql.Resultset, and the database is
Oracle. So far I haven't found any that provide hard numbers - such as, e.g.
"rs.get("col_name") took 2.3 times as long as rs.get(1)".
Does anyone have a link to such a comparison?
I'm not aware of any and the comparison would only be valid
for one specific version of one specific JDBC-driver for one
specific database (Resultset is only an interface, the
implementation is driver-specific).
But assuming that all implementations are using a map
for getting the column of a specific name, the performance-
difference shouldn't be that big.
But you're invited to do the test and tell us the results.
I would imagine the results of such a test to be highly sensitive to
optimization issues such as amount of available RAM, presence, number and
density of other activities in the JVM, GC algorithm in use, usage pattern of
the JDBC calls in the test, operating platform (OS and hardware) and so on.
I suspect that the only reliable conclusion in the face of JIT compilation and
its many varying optimization factors is "YMMV".
--
Lew