explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fiaG

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

Limit (cost=25.63..25.63 rows=1 width=2,696) (actual time=0.411..0.413 rows=1 loops=1)

2. 0.026 0.410 ↑ 1.0 1 1

Sort (cost=25.63..25.63 rows=1 width=2,696) (actual time=0.410..0.410 rows=1 loops=1)

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

GroupAggregate (cost=25.59..25.62 rows=1 width=2,696) (actual time=0.383..0.384 rows=1 loops=1)

  • Group Key: herald_article.id
  • Filter: (count(DISTINCT t6.id) > 0)
4. 0.046 0.326 ↓ 54.0 54 1

Sort (cost=25.59..25.60 rows=1 width=2,696) (actual time=0.322..0.326 rows=54 loops=1)

  • Sort Key: herald_article.id
  • Sort Method: quicksort Memory: 32kB
5. 0.032 0.280 ↓ 54.0 54 1

Nested Loop (cost=0.98..25.58 rows=1 width=2,696) (actual time=0.096..0.280 rows=54 loops=1)

  • Join Filter: (herald_article.id = t6.article_id)
6. 0.005 0.212 ↓ 18.0 18 1

Nested Loop (cost=0.83..25.04 rows=1 width=2,752) (actual time=0.087..0.212 rows=18 loops=1)

7. 0.022 0.171 ↓ 18.0 18 1

Nested Loop (cost=0.70..22.21 rows=1 width=2,756) (actual time=0.073..0.171 rows=18 loops=1)

  • Join Filter: (herald_article.id = t7.id)
8. 0.015 0.131 ↓ 18.0 18 1

Nested Loop (cost=0.56..21.67 rows=1 width=2,736) (actual time=0.062..0.131 rows=18 loops=1)

  • Join Filter: (herald_article.id = herald_comment.article_id)
9. 0.012 0.096 ↓ 10.0 10 1

Nested Loop (cost=0.42..21.12 rows=1 width=2,720) (actual time=0.054..0.096 rows=10 loops=1)

  • Join Filter: (t3.article_id = herald_article.id)
10. 0.010 0.064 ↓ 10.0 10 1

Nested Loop (cost=0.28..20.58 rows=1 width=32) (actual time=0.040..0.064 rows=10 loops=1)

11. 0.006 0.034 ↓ 10.0 10 1

Nested Loop (cost=0.14..19.80 rows=1 width=36) (actual time=0.023..0.034 rows=10 loops=1)

12. 0.016 0.016 ↓ 4.0 4 1

Seq Scan on herald_comment t3 (cost=0.00..11.62 rows=1 width=16) (actual time=0.014..0.016 rows=4 loops=1)

  • Filter: ((workflow_state)::text = 'visible'::text)
13. 0.012 0.012 ↓ 2.0 2 4

Index Scan using herald_comment_article_id_41e4841e on herald_comment t4 (cost=0.14..8.16 rows=1 width=20) (actual time=0.002..0.003 rows=2 loops=4)

  • Index Cond: (article_id = t3.article_id)
14. 0.020 0.020 ↑ 1.0 1 10

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

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

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

  • Index Cond: (id = t4.article_id)
  • Filter: ((workflow_state)::text = ANY ('{published,released,recommended}'::text[]))
16. 0.020 0.020 ↓ 2.0 2 10

Index Scan using herald_comment_article_id_41e4841e on herald_comment (cost=0.14..0.53 rows=1 width=16) (actual time=0.002..0.002 rows=2 loops=10)

  • Index Cond: (article_id = t4.article_id)
  • Filter: (published_date > '2019-10-28 14:46:57.848299+00'::timestamp with time zone)
  • Rows Removed by Filter: 1
17. 0.018 0.018 ↑ 1.0 1 18

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=18)

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

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

  • Index Cond: (id = t7.user_id)
  • Filter: ((workflow_state)::text = ANY ('{active,suspended}'::text[]))
19. 0.036 0.036 ↓ 3.0 3 18

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.002 rows=3 loops=18)

  • Index Cond: (article_id = t4.article_id)
Planning time : 27.481 ms
Execution time : 0.665 ms