I am not clear, how I can reply to the thread.
Thanks Andy for your below response. What kind of dataset are you querying? Often, much of th work is done on first call of .hasNext and .execSelect is just setup. You can do: ResultSet results = qexec.execSelect(); qexec.hasNext() ; as hasNext() is (as is correct for iterators) idempotent between calls of .next. Results aren't a StmtIterator, Correct me if I am wrong. Qexec.execSelect() is executing the query? And results.hasNext() lets you iterate thru the results correct? If that is true, then the time it begins iterating thru the iterator seems extremely slow, why is that the case? B.t.w. I don't see qexect.hasNext() as you suggest - what am I missing. From: Khandeshi, Ami D Sent: Friday, March 18, 2011 3:10 PM To: jena-users@incubator.apache.org Subject: jena and StmtIterator is time consuming operation Hi all, I noticed that iterating thru stmtiterator (thru hasNext) seems take long time. Can you suggest better/more efficient way to get information in a stattments? Here is a code base where execution query is fast, iterating thru result is time consuming. Thanks, Ami ResultSet results = qexec.execSelect(); System.out.println("got result"); List<Entity> entities = new ArrayList(); long time=System.currentTimeMillis(); System.out.println("Start Iteator"); for ( ; results.hasNext() ; ) { System.out.println("In iterator"+(time-System.currentTimeMillis()));