explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nNzc

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 6.003 ↑ 1.0 1 1

Limit (cost=24.31..24.31 rows=1 width=2,696) (actual time=6.000..6.003 rows=1 loops=1)

2. 0.033 6.000 ↑ 1.0 1 1

Sort (cost=24.31..24.31 rows=1 width=2,696) (actual time=5.999..6.000 rows=1 loops=1)

  • Sort Key: (count(t6.id)) DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.599 5.967 ↑ 1.0 1 1

GroupAggregate (cost=24.27..24.30 rows=1 width=2,696) (actual time=5.966..5.967 rows=1 loops=1)

  • Group Key: herald_article.id
  • Filter: (count(t6.id) > 0)
4. 2.082 5.368 ↓ 3,465.0 3,465 1

Sort (cost=24.27..24.28 rows=1 width=2,696) (actual time=4.960..5.368 rows=3,465 loops=1)

  • Sort Key: herald_article.id
  • Sort Method: quicksort Memory: 1017kB
5. 0.855 3.286 ↓ 3,465.0 3,465 1

Nested Loop (cost=0.98..24.26 rows=1 width=2,696) (actual time=0.045..3.286 rows=3,465 loops=1)

  • Join Filter: (herald_article.id = t6.article_id)
6. 0.176 1.486 ↓ 315.0 315 1

Nested Loop (cost=0.83..23.72 rows=1 width=2,752) (actual time=0.043..1.486 rows=315 loops=1)

7. 0.159 0.995 ↓ 315.0 315 1

Nested Loop (cost=0.70..21.96 rows=1 width=2,756) (actual time=0.041..0.995 rows=315 loops=1)

  • Join Filter: (herald_article.id = t7.id)
8. 0.081 0.521 ↓ 315.0 315 1

Nested Loop (cost=0.56..21.42 rows=1 width=2,736) (actual time=0.039..0.521 rows=315 loops=1)

  • Join Filter: (herald_article.id = herald_comment.article_id)
9. 0.046 0.260 ↓ 45.0 45 1

Nested Loop (cost=0.42..20.87 rows=1 width=2,720) (actual time=0.036..0.260 rows=45 loops=1)

  • Join Filter: (t3.article_id = herald_article.id)
10. 0.000 0.169 ↓ 45.0 45 1

Nested Loop (cost=0.28..20.33 rows=1 width=32) (actual time=0.029..0.169 rows=45 loops=1)

11. 0.023 0.070 ↓ 99.0 99 1

Nested Loop (cost=0.14..19.80 rows=1 width=36) (actual time=0.020..0.070 rows=99 loops=1)

12. 0.020 0.020 ↓ 9.0 9 1

Seq Scan on herald_comment t3 (cost=0.00..11.62 rows=1 width=16) (actual time=0.015..0.020 rows=9 loops=1)

  • Filter: ((workflow_state)::text = 'visible'::text)
  • Rows Removed by Filter: 2
13. 0.027 0.027 ↓ 11.0 11 9

Index Scan using herald_comment_article_id_41e4841e on herald_comment t4 (cost=0.14..8.16 rows=1 width=20) (actual time=0.001..0.003 rows=11 loops=9)

  • Index Cond: (article_id = t3.article_id)
14. 0.099 0.099 ↓ 0.0 0 99

Index Scan using herald_user_pkey on herald_user (cost=0.14..0.52 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=99)

  • Index Cond: (id = t4.user_id)
  • Filter: ((workflow_state)::text = ANY ('{active,suspended}'::text[]))
15. 0.045 0.045 ↑ 1.0 1 45

Index Scan using herald_article_pkey on herald_article (cost=0.14..0.53 rows=1 width=2,688) (actual time=0.001..0.001 rows=1 loops=45)

  • Index Cond: (id = t4.article_id)
  • Filter: ((workflow_state)::text = ANY ('{published,released,recommended}'::text[]))
16. 0.180 0.180 ↓ 7.0 7 45

Index Scan using herald_comment_article_id_41e4841e on herald_comment (cost=0.14..0.53 rows=1 width=16) (actual time=0.001..0.004 rows=7 loops=45)

  • Index Cond: (article_id = t4.article_id)
  • Filter: (published_date > '2019-10-28 12:19:55.596118+00'::timestamp with time zone)
  • Rows Removed by Filter: 4
17. 0.315 0.315 ↑ 1.0 1 315

Index Scan using herald_article_pkey on herald_article t7 (cost=0.14..0.52 rows=1 width=20) (actual time=0.001..0.001 rows=1 loops=315)

  • Index Cond: (id = t4.article_id)
18. 0.315 0.315 ↑ 1.0 1 315

Index Scan using herald_user_pkey on herald_user t8 (cost=0.14..1.75 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=315)

  • Index Cond: (id = t7.user_id)
  • Filter: ((workflow_state)::text = ANY ('{active,suspended}'::text[]))
19. 0.945 0.945 ↓ 11.0 11 315

Index Scan using herald_comment_article_id_41e4841e on herald_comment t6 (cost=0.14..0.53 rows=1 width=24) (actual time=0.001..0.003 rows=11 loops=315)

  • Index Cond: (article_id = t4.article_id)
Planning time : 34.627 ms
Execution time : 6.272 ms