我正在使用pgAdmin 4进行PostgreSQL编程,并尝试进行一些查询性能优化。当我使用EXPLAIN ANALYZE(或)EXPLAIN(VERBOSE TRUE)运行查询时,我看到的“数据输出”如下截图所示。
如何以此格式获得EXPLAIN ANALYZE的输出(或导出当前的“数据输出”),以便可以将其输入http://explain.depesz.com中:
![enter image description here](https://istack.dev59.com/gNCqZ.webp)
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