问题
I'm programming Java application working with Apache Derby and i'm looking for equivalent for "explain" statement (working for mySQL for example). It's not working in Derby. Is there something similar?
回答1:
There are similar things: Firstly, there is derby.language.logQueryPlan=true, which writes query plan information to the log file: http://db.apache.org/derby/docs/10.8/ref/rrefproper43414.html. Secondly, there is the RUNTIMESTATISTICS feature, which can capture the statistics into your program if you want: http://db.apache.org/derby/docs/10.8/ref/rrefsqlj38831.html. Thirdly, there is XPLAIN style, which captures query plan information into a set of tables inside your database itself: http://db.apache.org/derby/docs/10.8/ref/rref_xplain_tables.html.
You should probably also spend some time reading this: http://db.apache.org/derby/docs/10.8/tuning/ctundepth13055.html
来源:https://stackoverflow.com/questions/5981406/apache-derby-explain-select