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

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

五年后,我无法在这个屏幕上完成它。 相反,我去了查询屏幕,在我的查询之前写了EXPLAIN ANALYSE并运行它。然后进入数据输出,选择第一个单元格,并突出显示所有单元格(Ctrl-A),然后按CTRL-C复制它们。 然后您可以将其粘贴到explain.depesz中。 - Stuart Axon
1个回答

1
使用pgAdmin4的内置解释选项,获取您所需的输出。

enter image description here

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


你检查了输出文件里实际得到的内容了吗? - klin
我得到了JSON解释输出,但工具提示的问题不被接受。 - Zia Ul Rehman Mughal
@Murtuza Z...你节省了我的时间,帮助我复制了解释计划。谢谢。 - VBAGuy

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接