# PlanExporter

Use the `PlanExporter` tool to export query plan data for further analysis.

The query plan data can be exported in a variety of formats:

- XML, the base format for exported query plan data
- HTML, which helps you view graphically the execution plans of complex queries you have executed

By using this tool, you can avoid querying XPLAIN style tables to get a basic idea of the query plan followed by the optimizer.

You can specify other query plan export formats by specifying an appropriate XSL stylesheet to transform the query plan data, or you can export the query plan data as XML, then reformat it as appropriate using any external XML-aware tool of your choice.

Note: The `PlanExporter` tool is in an experimental stage. The Derby team welcomes feedback on how to improve it.

- Using PlanExporter
  Before you run the PlanExporter tool, make sure that your classpath contains the Derby jar files, including derbytools.jar/
- PlanExporter XML format
  The PlanExporter tool extracts the query plan of an executed query as a XML document by using the statistics captured from Derby XPLAIN style tables.
- PlanExporter example
  This example shows the steps that you must follow in order to use the PlanExporter tool.