SQL Workbench + PostgreSQL: how to show execution plans?

3.1k views Asked by At

I have recently started using SQL Workbench instead of pgAdmin to run queries on a PostgreSQL 9.3 server.

Is there any way to show the execution plan? I looked everywhere but only managed to find an option to do it with Oracle, not PostgreSQL.

Thank you!

1

There are 1 answers

1
AudioBubble On

It's the same as in psql

Simply run:

explain (verbose true, analyze true)
select some_column
from some_table
where another_column = 42

The execution plan will then be shown as the result of that query.

The manual contains an example on how you can put this into a macro and run this automatically:

http://www.sql-workbench.net/manual/macros.html#executable-macros