There's an implied index on the primary key of a file. So the database engine didn't touch the file at all, it just read straight from the index.
Opening a result set doesn't fetch all the rows, just the first handful. The rest are fetched as you "next()" through the result set. So you'd probably get the same response whether the table had half-a-million rows or thirty or thirty million.
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of James H. H. Lampert
Sent: Tuesday, July 02, 2013 4:49 PM
To: Java Programming on and around the IBM i
Subject: Re: JDBC equivalent to RPG SETLL or CHAIN?
Here's a thought:
I just tried this from Squirrel, on my WinDoze box (which is far more "old-and-busted" than "new hotness," which should surprise nobody who knows me). I found that I could open and fetch a result set of just the keyfield of an entire file with 554892 active records (and some 80-odd deleted ones), in 6 seconds flat. (The same thing with a 24047-record file gave sub-second response.) Perhaps I could use that to tell me where I am, relative to the entire file . . .
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l
As an Amazon Associate we earn from qualifying purchases.