db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher L. Fleck" <clfl...@bellsouth.net>
Subject RE: Query Plans
Date Sat, 12 Apr 2008 16:28:04 GMT
I figured out what my problem is.  The query plan isn't displayed until you
close the statement.

-----Original Message-----
From: Christopher L. Fleck [mailto:clfleck@bellsouth.net] 
Sent: Wednesday, November 28, 2007 3:14 PM
To: 'Derby Discussion'
Subject: RE: Query Plans

Is this not sufficient:

private static void printResultSet(ResultSet results) {
	try { 
		while(results.next()) {
			for(int i = 1; 
			i <= results.getMetaData().getColumnCount(); 
			i++) {
				System.out.print(results.getString(i) +
"\t");
			}
			System.out.println();
		}
	} catch(SQLException e) { e.printStackTrace(); }
}

Also, I'm not sure if that would explain why I sometimes get the query plan
but not always.  With the same query, the query plan may show up or it may
not.  

Thank you for responding,
CLF

-----Original Message-----
From: Bryan Pendleton [mailto:bpendleton@amberpoint.com] 
Sent: Wednesday, November 28, 2007 3:07 PM
To: Derby Discussion
Subject: Re: Query Plans

> I've got query plan logging enabled in Derby, but, for some reason, I 
> only see query plans for my selects seemingly at random. 

Make sure you're fully retrieving all the rows from the result set.
I think I remember that query plan logging only occurs at the completion
of execution, after all the rows have been fully fetched.

thanks,

bryan


Mime
View raw message