A DBeaver plug-in which runs EXPLAIN on the active query of the SQL editor and opens the plan in
PEV2, the PostgreSQL explain visualizer of Dalibo. PEV2 is
embedded in the plug-in: the plan never leaves your machine.
SQL editor (PostgreSQL connection) > side toolbar > PEV2 button
You can find the latest build of dbeaver-pev2 here:
https://github.com/RoiSoleil/dbeaver-pev2/raw/update-site/latest/
- PEV2 button in the side toolbar of the SQL editor, shown only for PostgreSQL connections.
- A click on the button runs the active query with
EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)and opens the plan in a PEV2 editor. - The drop down of the button gives the same explain without
ANALYZE(EXPLAIN (COSTS, VERBOSE, FORMAT JSON)): the query is planned but not executed, which suits slow queries andINSERT/UPDATE/DELETEstatements. - Query parameters are asked as for a normal execution in DBeaver.
- Save As... in the PEV2 editor writes the query and its plan to a
.pev2file, which reopens in the same editor. - The embedded PEV2 follows the upstream releases: a daily GitHub Actions workflow opens a pull request when a new version is published.
Requires JDK 21 and Maven 3.9.11 (Maven 3.9.12 has a regression with Tycho).
mvn clean install # update site in update-site/org.eclipse.dbeaver-pev2/target/repositoryEvery push to main is built by GitHub Actions, which publishes the update site to the
update-site branch and a zipped copy to the latest release.
The tests are SWTBot tests: they start a full DBeaver workbench, so they open windows on the
current display, and the integration test connects to a PostgreSQL database initialized with
bundles/org.eclipse.dbeaver-pev2.tests/schema.sql:
mvn clean verify -Pcoverage -Duser.language=en -Duser.country=US \
-Ddb.host=localhost -Ddb.port=5432 -Ddb.database=dbeaver_test -Ddb.user=test -Ddb.password=testThe locale must be English because the tests look for the labels of the DBeaver wizards. GitHub Actions runs them against PostgreSQL 18 and sends the coverage to Codecov.
- The plug-in is built against the latest Eclipse release and the latest DBeaver update site.
- With
ANALYZEthe query is really executed: use the drop down entry withoutANALYZEfor a statement which modifies data, or run it in a transaction you roll back. - Without
ANALYZEPEV2 shows the estimated costs and rows only, there are no timings or buffers.
MIT. The bundled PEV2 is distributed under the PostgreSQL license.
