db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag.Wan...@Sun.COM (Dag H. Wanvik)
Subject Re: Slow Query
Date Mon, 04 May 2009 00:51:35 GMT
DaveG24 <dave4aries@gmail.com> writes:

> Actually, I have a pretty complicated query that runs fine in ij and takes
> about 1 second to return 0 rows.  When I start my Java application, point to
> the derby.jar that contains my database, and run the same query, it takes 42
> seconds to return 0 rows.  Needless to say, I'm perplexed.  I can tune
> queries in the database, but I've never had a fast query go so much slower
> from an application.
> My Java application is a standalone app, all running from a directory
> structure that contains the jars and the database.  It also contains jre
> 1.6, and the database is derby, running on Windows XP.
> So, it's not really a derby problem - I don't think - but I don't know how
> to attack it.  I thought I'd see if anyone out there has experienced
> anything like this.

If Derby chooses a different (less optimal) execution plan in the
second case, that could account for the difference.

Derby lets you retrieve the chosen execution plan, cf.

Is the plan the same in the two cases?


View raw message