On 4/2/2013 9:53 AM, John English wrote:
On 02/04/2013 18:34, Knut Anders Hatlen wrote:
My guess is that it's the sort avoidance code that somehow gets confused
into thinking the result is already in the correct order and that the
sorting could be skipped. Hope you manage to reproduce it so we can fix
it.

OK, this sounds possible. However, I've just tried a stripped-down example using a prepared statement (yes, the username is a PS parameter) and it works correctly, so I'm still trying.

Is there a way to get at the execution plan at the right level of detail that I could use to see what's happening on a copy of the live database?
In derby.properties set:

derby.language.logStatementText=true
derby.language.logQueryPlan=true

(I am a bear of very little brain when it gets to understanding execution plans!)

If you can post the two plans, someone might be able to give you the optimizer overrides to force the plan with incorrect sorting.

Many thanks,

Reply via email to