DaveG24 <[email protected]> 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 10.5.1.1, 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. http://db.apache.org/derby/docs/10.5/tuning/ttundepth34375.html Is the plan the same in the two cases? Dag
