9

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?

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
planky
  • 440
  • 1
  • 4
  • 16

1 Answers1

11

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

Yuri
  • 4,254
  • 1
  • 29
  • 46
Bryan Pendleton
  • 16,128
  • 3
  • 32
  • 56