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.

-----Original Message-----
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

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.