Hi donald, donaldp wrote: > Hello all, > > I'm trying to do some optimization work on my statements but I can't get > logQueryPlan to work. > > I tried setting it on the command line (-Dderby.language.logQueryPlan=true) > of ij.bat and the startnetworkserver.bat. Does not work. I tried to set it > in the derby.properties file, does not work either. I tried it in my app too > using the same techniques in addition to using jdbc connection properties. > Does not work.
Well, setting system properties as parameters to the script most likely will not work. Not sure if this is what you did, though. You need to use derby.properties, edit the scripts, or set an environment variable called DERBY_OPTS. I tried setting the logQueryPlan property in connection with using the bin\ij.bat script on Win2003, Derby 10.4.1.3. I tried two different variants, and both worked for me: 1) I created a derby.properties file in the directory from which I executed ij.bat. This property file contained: derby.language.logQueryPlan=true I ran a couple of sql statements against a database using the embedded driver, and the query plans showed up in derby.log. 2) I set the environment property DERBY_OPTS in my command window prior to running ij.bat, like this: set DERBY_OPTS=-Dderby.language.logQueryPlan=true I also set DERBY_HOME to the installation directory, and ran bin\ij.bat. No derby.properties file this time. Query plans showed up in derby.log when executing statements against an embedded database. So I'm not sure what the issue could be, if you've tried the above methods. You could try to see if running ij or the server through derbyrun.jar directly instead of via the scripts work for you, e.g. like this: java -Dderby.language.logQueryPlan=true -jar %DERBY_HOME%\lib\derbyrun.jar ij java -Dderby.language.logQueryPlan=true -jar %DERBY_HOME%\lib\derbyrun.jar server start Hope this helps, -- John
