explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7f1Q

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 3.315 ↑ 1.0 1 1

Limit (cost=523.99..524.03 rows=1 width=172) (actual time=3.314..3.315 rows=1 loops=1)

2.          

CTE tmp_rrj

3. 0.422 2.620 ↓ 1.1 130 1

HashAggregate (cost=435.21..437.04 rows=122 width=16) (actual time=2.499..2.620 rows=130 loops=1)

4. 0.183 2.198 ↓ 1.2 147 1

Hash Join (cost=15.95..434.60 rows=122 width=16) (actual time=0.387..2.198 rows=147 loops=1)

  • Hash Cond: (jus_1.id = rrj.id_user_story)
5. 1.651 1.651 ↑ 1.0 386 1

Seq Scan on user_stories jus_1 (cost=0.00..414.05 rows=386 width=8) (actual time=0.005..1.651 rows=386 loops=1)

  • Filter: ((apagado IS FALSE) AND (id_estado <> ALL ('{10001,10028}'::bigint[])))
  • Rows Removed by Filter: 1,298
6. 0.188 0.364 ↑ 1.0 531 1

Hash (cost=9.31..9.31 rows=531 width=16) (actual time=0.364..0.364 rows=531 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
7. 0.176 0.176 ↑ 1.0 531 1

Seq Scan on requisicoes_jira rrj (cost=0.00..9.31 rows=531 width=16) (actual time=0.010..0.176 rows=531 loops=1)

8. 0.001 3.313 ↑ 1.0 1 1

Unique (cost=86.96..86.99 rows=1 width=172) (actual time=3.312..3.313 rows=1 loops=1)

9. 0.044 3.312 ↑ 1.0 1 1

Sort (cost=86.96..86.96 rows=1 width=172) (actual time=3.311..3.312 rows=1 loops=1)

  • Sort Key: ((date(now()) - date(jus.data_criacao))), jus.id, jus.key, jus.assunto, jus.data_criacao, jus.data_atualizacao, jus.data_fecho_pedido, jus.id_tipo, jus.id_utilizador_atribuido, tmp_rrj.ticket, juse.descricao, jus.tempo_estimado, ((SubPlan 2))
  • Sort Method: quicksort Memory: 25kB
10. 0.020 3.268 ↑ 1.0 1 1

Nested Loop Left Join (cost=82.46..86.95 rows=1 width=172) (actual time=3.263..3.268 rows=1 loops=1)

11. 0.035 3.203 ↑ 1.0 1 1

Hash Right Join (cost=82.32..85.23 rows=1 width=148) (actual time=3.201..3.203 rows=1 loops=1)

  • Hash Cond: (tmp_rrj.id_user_story = jus.id)
12. 2.704 2.704 ↓ 1.1 130 1

CTE Scan on tmp_rrj (cost=0.00..2.44 rows=122 width=40) (actual time=2.503..2.704 rows=130 loops=1)

13. 0.005 0.464 ↑ 1.0 1 1

Hash (cost=82.31..82.31 rows=1 width=116) (actual time=0.464..0.464 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
14. 0.005 0.459 ↑ 1.0 1 1

Nested Loop (cost=0.28..82.31 rows=1 width=116) (actual time=0.456..0.459 rows=1 loops=1)

15. 0.054 0.432 ↓ 2.0 2 1

Seq Scan on user_stories_planeamento jusp (cost=0.00..74.00 rows=1 width=16) (actual time=0.087..0.432 rows=2 loops=1)

  • Filter: ((deleted IS FALSE) AND ((SubPlan 3) = 0))
  • Rows Removed by Filter: 39
16.          

SubPlan (for Seq Scan)

17. 0.042 0.378 ↑ 1.0 1 21

Aggregate (cost=1.80..1.81 rows=1 width=0) (actual time=0.018..0.018 rows=1 loops=21)

18. 0.336 0.336 ↑ 1.0 1 21

Seq Scan on user_stories_planeamento user_stories_planeamento_1 (cost=0.00..1.80 rows=1 width=0) (actual time=0.009..0.016 rows=1 loops=21)

  • Filter: ((deleted IS FALSE) AND (id_user_story = jusp.id_user_story) AND ((year > 2019) OR ((year = 2,019) AND (week >= 34))))
  • Rows Removed by Filter: 40
19. 0.022 0.022 ↓ 0.0 0 2

Index Scan using user_stories_pkey on user_stories jus (cost=0.28..8.30 rows=1 width=108) (actual time=0.011..0.011 rows=0 loops=2)

  • Index Cond: (id = jusp.id_user_story)
  • Filter: ((apagado IS FALSE) AND (id_estado <> ALL ('{10001,10028}'::bigint[])))
  • Rows Removed by Filter: 0
20. 0.014 0.014 ↑ 1.0 1 1

Index Scan using user_stories_estados_pkey on user_stories_estados juse (cost=0.14..0.18 rows=1 width=40) (actual time=0.012..0.014 rows=1 loops=1)

  • Index Cond: (id = jus.id_estado)
21.          

SubPlan (for Nested Loop Left Join)

22. 0.010 0.031 ↑ 1.0 1 1

Aggregate (cost=1.50..1.51 rows=1 width=8) (actual time=0.030..0.031 rows=1 loops=1)

23. 0.021 0.021 ↑ 1.0 1 1

Seq Scan on user_stories_planeamento (cost=0.00..1.50 rows=1 width=8) (actual time=0.019..0.021 rows=1 loops=1)

  • Filter: ((deleted IS FALSE) AND (ignore IS FALSE) AND (id = jusp.id))
  • Rows Removed by Filter: 40
Total runtime : 3.567 ms