Does PostgreSQL Explain Analyze Execution Time consider Fetching time
2
votes
2
answers
2286
views
I have some tests on GitHub which record how much time it takes to execute a query and fetch all results.
If I check the execution plan, I get:
Index Scan using post_comment_pkey on post_comment postcommen0_ (cost=0.29..2716.48 rows=34752 width=43) (actual time=6.767..14.352 rows=34880 loops=1)
Filter: (post_id = 1)
Rows Removed by Filter: 34880
Planning time: 0.659 ms
Execution time: 14.840 ms
So, the query is using an index and executing in 15 ms.
However, on the Java side, after the ResultSet is fetched and processed, the time measurement indicates that it took 90 ms.
The only explanation would be that the Explain Analyze doe snot consider the fetch time and fetching 34880 records takes 50-60 ms.
Is this correct?
Asked by Vlad Mihalcea
(917 rep)
Sep 2, 2016, 03:29 PM
Last activity: Nov 27, 2022, 11:25 PM
Last activity: Nov 27, 2022, 11:25 PM