如何从pgAdmin 4导出EXPLAIN数据输出

时间:2017-02-25 17:55:21

标签: postgresql pgadmin pgadmin-4

我正在使用pgAdmin 4处理postgresql。我正在尝试进行一些查询性能优化。 当我使用EXPLAIN ANALYZE(或)EXPLAIN(VERBOSE TRUE)运行查询时,我看到的'数据输出'显示在下面的屏幕截图中。 enter image description here

如何以这种格式获取EXPLAIN ANALYZE的输出(或导出我当前的'数据输出'),我可以输入http://explain.depesz.com

QUERY PLAN
--------------------------------------------------------------------------------------------------------------
 Sort  (cost=29.71..29.73 rows=6 width=64) (actual time=0.189..16.233 rows=7 loops=1)
   Sort Key: books.title
   ->  Nested Loop  (cost=0.00..29.63 rows=6 width=64) (actual time=0.068..0.129 rows=7 loops=1)
         ->  Index Scan using authors_pkey on authors  (cost=0.00..5.82 rows=1 width=36) (actual time=0.029..0.033 rows=1 loops=1)
               Index Cond: (id = 16)
         ->  Seq Scan on books  (cost=0.00..23.75 rows=6 width=36) (actual time=0.026..0.052 rows=7 loops=1)
               Filter: (author_id = 16)
 Total runtime: 16.386 ms

1 个答案:

答案 0 :(得分:0)

使用pgAdmin4的内置解释选项来获得所需的输出。

enter image description here

现在您可以复制“数据输出”选项卡中的输出。

相关问题