explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HuFD

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 4,820.942 ↑ 1.0 10 1

Limit (cost=274,441.16..274,441.19 rows=10 width=318) (actual time=4,820.936..4,820.942 rows=10 loops=1)

2. 2.351 4,820.937 ↑ 205.0 10 1

Sort (cost=274,441.16..274,446.29 rows=2,050 width=318) (actual time=4,820.935..4,820.937 rows=10 loops=1)

  • Sort Key: bp1.date_last_comment DESC
  • Sort Method: top-N heapsort Memory: 61kB
3. 58.598 4,818.586 ↓ 1.9 3,878 1

GroupAggregate (cost=274,325.11..274,396.86 rows=2,050 width=318) (actual time=4,756.659..4,818.586 rows=3,878 loops=1)

  • Group Key: bp1.id_post
4. 9.547 4,759.988 ↓ 1.8 7,268 1

Sort (cost=274,325.11..274,335.36 rows=4,100 width=318) (actual time=4,756.630..4,759.988 rows=7,268 loops=1)

  • Sort Key: bp1.id_post
  • Sort Method: quicksort Memory: 8853kB
5. 5.684 4,750.441 ↓ 1.8 7,268 1

Nested Loop Left Join (cost=133.55..274,079.09 rows=4,100 width=318) (actual time=0.088..4,750.441 rows=7,268 loops=1)

6. 21.353 21.353 ↓ 1.9 3,878 1

Index Scan using fki_blog_posts_blogs on posts bp1 (cost=0.43..1,099.36 rows=2,050 width=68) (actual time=0.015..21.353 rows=3,878 loops=1)

  • Index Cond: (id_blog = ANY ('{1,22,6}'::integer[]))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 1750
7. 11.634 4,723.404 ↑ 1.0 2 3,878

Subquery Scan on j1 (cost=133.12..133.14 rows=2 width=250) (actual time=1.217..1.218 rows=2 loops=3,878)

8. 3.878 4,711.770 ↑ 1.0 2 3,878

Limit (cost=133.12..133.12 rows=2 width=476) (actual time=1.215..1.215 rows=2 loops=3,878)

9. 89.194 4,707.892 ↑ 19.0 2 3,878

Sort (cost=133.12..133.21 rows=38 width=476) (actual time=1.214..1.214 rows=2 loops=3,878)

  • Sort Key: bc1.thread_date DESC
  • Sort Method: top-N heapsort Memory: 25kB
10. 903.574 4,618.698 ↓ 1.1 42 3,878

GroupAggregate (cost=131.88..132.74 rows=38 width=476) (actual time=0.953..1.191 rows=42 loops=3,878)

  • Group Key: bc1.id_comment
11. 197.778 3,715.124 ↓ 1.5 56 3,878

Sort (cost=131.88..131.98 rows=38 width=476) (actual time=0.943..0.958 rows=56 loops=3,878)

  • Sort Key: bc1.id_comment
  • Sort Method: quicksort Memory: 48kB
12. 240.174 3,517.346 ↓ 1.5 56 3,878

Nested Loop Left Join (cost=3.16..130.88 rows=38 width=476) (actual time=0.033..0.907 rows=56 loops=3,878)

13. 376.166 376.166 ↓ 1.1 42 3,878

Index Scan using idx_comments_posts_parents on comments bc1 (cost=0.56..31.32 rows=38 width=234) (actual time=0.011..0.097 rows=42 loops=3,878)

  • Index Cond: ((id_post = bp1.id_post) AND (id_parent = 0))
14. 0.000 2,901.006 ↑ 1.0 1 161,167

Subquery Scan on j2 (cost=2.59..2.61 rows=1 width=250) (actual time=0.018..0.018 rows=1 loops=161,167)

15. 161.167 2,901.006 ↑ 1.0 1 161,167

Limit (cost=2.59..2.60 rows=1 width=226) (actual time=0.017..0.018 rows=1 loops=161,167)

16. 644.668 2,739.839 ↑ 1.0 1 161,167

Sort (cost=2.59..2.60 rows=1 width=226) (actual time=0.017..0.017 rows=1 loops=161,167)

  • Sort Key: bc2.comment_number DESC
  • Sort Method: quicksort Memory: 25kB
17. 2,095.171 2,095.171 ↓ 4.0 4 161,167

Index Scan using idx_comments_posts_roots on comments bc2 (cost=0.56..2.58 rows=1 width=226) (actual time=0.005..0.013 rows=4 loops=161,167)

  • Index Cond: ((id_post = bc1.id_post) AND (id_root = bc1.id_comment))
  • Filter: (id_parent <> 0)
  • Rows Removed by Filter: 1
Planning time : 0.565 ms
Execution time : 4,821.053 ms