explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jnH0

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=8,383,233,452.15..8,383,266,037.91 rows=13,034,303 width=260) (actual rows= loops=)

  • Sort Key: cs.ds_texto, (CASE WHEN ((e.cd_evento)::text = '265'::text) THEN 'RG'::text WHEN ((e.cd_evento)::text = '11975'::text) THEN 'RR'::text WHEN ((e.cd_evento)::text = '12099'::text) THEN 'IRDR'::text WHEN ((e.cd_evento)::text = '12100'::text) THEN (...)
2. 0.000 0.000 ↓ 0.0

Hash Join (cost=151,073.37..8,380,089,237.60 rows=13,034,303 width=260) (actual rows= loops=)

  • Hash Cond: ((e.id_evento)::integer = ("ANY_subquery".id_evento)::integer)
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=150,474.37..2,472,198.26 rows=26,068,606 width=69) (actual rows= loops=)

  • Hash Cond: ((pe.id_evento)::integer = (e.id_evento)::integer)
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=150,425.51..2,403,248.51 rows=26,068,606 width=60) (actual rows= loops=)

  • Hash Cond: ((pe.id_processo)::integer = (pt.id_processo_trf)::integer)
5. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=18,698.56..1,595,581.51 rows=26,141,822 width=18) (actual rows= loops=)

  • Merge Cond: ((pe.id_processo_evento)::integer = cs.id_movimento_processo)
6. 0.000 0.000 ↓ 0.0

Index Scan using tb_processo_evento_pkey on tb_processo_evento pe (cost=0.44..1,511,450.02 rows=26,141,822 width=20) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Sort (cost=18,698.12..18,711.26 rows=5,254 width=14) (actual rows= loops=)

  • Sort Key: cs.id_movimento_processo
8. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_complemento_segmentado cs (cost=105.59..18,373.45 rows=5,254 width=14) (actual rows= loops=)

  • Recheck Cond: (id_tipo_complemento = ANY ('{52,54}'::bigint[]))
9. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_complemento_segmentado1 (cost=0.00..104.28 rows=5,254 width=0) (actual rows= loops=)

  • Index Cond: (id_tipo_complemento = ANY ('{52,54}'::bigint[]))
10. 0.000 0.000 ↓ 0.0

Hash (cost=108,608.99..108,608.99 rows=1,038,237 width=50) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash Join (cost=45,183.44..108,608.99 rows=1,038,237 width=50) (actual rows= loops=)

  • Hash Cond: ((pt.id_orgao_julgador)::integer = (oj.id_orgao_julgador)::integer)
12. 0.000 0.000 ↓ 0.0

Hash Join (cost=45,167.86..105,826.35 rows=1,038,237 width=49) (actual rows= loops=)

  • Hash Cond: ((pt.id_classe_judicial)::integer = (cj.id_classe_judicial)::integer)
13. 0.000 0.000 ↓ 0.0

Hash Join (cost=45,096.94..103,014.70 rows=1,038,237 width=49) (actual rows= loops=)

  • Hash Cond: ((pt.id_processo_trf)::integer = (p.id_processo)::integer)
14. 0.000 0.000 ↓ 0.0

Seq Scan on tb_processo_trf pt (cost=0.00..35,906.37 rows=1,038,237 width=20) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=24,964.53..24,964.53 rows=1,041,153 width=29) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on tb_processo p (cost=0.00..24,964.53 rows=1,041,153 width=29) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash (cost=61.52..61.52 rows=752 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on tb_classe_judicial cj (cost=0.00..61.52 rows=752 width=8) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=12.48..12.48 rows=248 width=9) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on tb_orgao_julgador oj (cost=0.00..12.48 rows=248 width=9) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=41.16..41.16 rows=616 width=9) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on tb_evento e (cost=0.00..41.16 rows=616 width=9) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Hash (cost=596.50..596.50 rows=200 width=4) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

HashAggregate (cost=594.50..596.50 rows=200 width=4) (actual rows= loops=)

  • Group Key: ("ANY_subquery".id_evento)::integer
25. 0.000 0.000 ↓ 0.0

Subquery Scan on ANY_subquery (cost=533.62..589.81 rows=1,873 width=4) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

CTE Scan on arvore_eventos (cost=533.62..571.08 rows=1,873 width=4) (actual rows= loops=)

27.          

CTE arvore_eventos

28. 0.000 0.000 ↓ 0.0

Recursive Union (cost=13.14..533.62 rows=1,873 width=153) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_evento e_1 (cost=13.14..22.55 rows=3 width=153) (actual rows= loops=)

  • Recheck Cond: ((cd_evento)::text = ANY ('{265,11975,12099,12100}'::text[]))
  • Filter: in_ativo
30. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_cdevento_idevent_idsup_ativo (cost=0.00..13.14 rows=3 width=0) (actual rows= loops=)

  • Index Cond: (((cd_evento)::text = ANY ('{265,11975,12099,12100}'::text[])) AND (in_ativo = true))
31. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.97..47.36 rows=187 width=153) (actual rows= loops=)

  • Hash Cond: ((e2.id_evento_superior)::integer = (aa.id_evento)::integer)
32. 0.000 0.000 ↓ 0.0

Seq Scan on tb_evento e2 (cost=0.00..41.16 rows=521 width=13) (actual rows= loops=)

  • Filter: in_ativo
33. 0.000 0.000 ↓ 0.0

Hash (cost=0.60..0.60 rows=30 width=149) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

WorkTable Scan on arvore_eventos aa (cost=0.00..0.60 rows=30 width=149) (actual rows= loops=)

35.          

SubPlan (forHash Join)

36. 0.000 0.000 ↓ 0.0

Aggregate (cost=323.72..323.74 rows=1 width=32) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Hash Join (cost=15.62..323.72 rows=1 width=8) (actual rows= loops=)

  • Hash Cond: ((pe1.id_evento)::integer = (e1.id_evento)::integer)
38. 0.000 0.000 ↓ 0.0

Index Scan using idx_tb_processo_evento1 on tb_processo_evento pe1 (cost=0.44..307.98 rows=214 width=12) (actual rows= loops=)

  • Index Cond: ((id_processo)::integer = (pe.id_processo)::integer)
39. 0.000 0.000 ↓ 0.0

Hash (cost=15.16..15.16 rows=2 width=4) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tb_evento e1 (cost=8.57..15.16 rows=2 width=4) (actual rows= loops=)

  • Recheck Cond: ((cd_evento)::text = ANY ('{848,246}'::text[]))
41. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_evento_cdevento_id_evento (cost=0.00..8.57 rows=2 width=0) (actual rows= loops=)

  • Index Cond: ((cd_evento)::text = ANY ('{848,246}'::text[]))
42. 0.000 0.000 ↓ 0.0

Aggregate (cost=318.95..318.96 rows=1 width=32) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..318.94 rows=1 width=8) (actual rows= loops=)

  • Join Filter: ((pe1_1.id_evento)::integer = (e1_1.id_evento)::integer)
44. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_evento_cdevento_id_evento on tb_evento e1_1 (cost=0.28..8.29 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (cd_evento = '848'::text)
45. 0.000 0.000 ↓ 0.0

Index Scan using idx_tb_processo_evento1 on tb_processo_evento pe1_1 (cost=0.44..307.98 rows=214 width=12) (actual rows= loops=)

  • Index Cond: ((id_processo)::integer = (pe.id_processo)::integer)