explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6FOK

Settings
# exclusive inclusive rows x rows loops node
1. 0.502 103,430.886 ↑ 5.2 116 1

Unique (cost=456,615,235.03..456,615,339.18 rows=608 width=4) (actual time=103,429.930..103,430.886 rows=116 loops=1)

2. 2.057 103,430.384 ↑ 24.9 835 1

Sort (cost=456,615,235.03..456,615,287.11 rows=20,831 width=4) (actual time=103,429.927..103,430.384 rows=835 loops=1)

  • Sort Key: sessao1_.dt_sessao
  • Sort Method: quicksort Memory: 64kB
3. 1,118.977 103,428.327 ↑ 24.9 835 1

Nested Loop (cost=0.42..456,613,740.78 rows=20,831 width=4) (actual time=9.624..103,428.327 rows=835 loops=1)

  • Join Filter: ((sessaopaut0_.id_sessao)::integer = (sessao1_.id_sessao)::integer)
  • Rows Removed by Join Filter: 2087500
4. 1,015.034 101,299.835 ↑ 25.0 835 1

Index Scan using tb_sessao_pauta_proc_trf_tp_situacao_julgamento_idx on tb_sessao_pauta_proc_trf sessaopaut0_ (cost=0.42..455,832,474.97 rows=20,848 width=4) (actual time=4.210..101,299.835 rows=835 loops=1)

  • Index Cond: (tp_situacao_julgamento = 'JG'::bpchar)
  • Filter: ((dt_exclusao_processo IS NULL) AND (NOT (SubPlan 1)) AND ((NOT (SubPlan 2)) OR (NOT (SubPlan 3)) OR (NOT (SubPlan 4)) OR (NOT (SubPlan 5)) OR (SubPlan 6)))
  • Rows Removed by Filter: 48312
5.          

SubPlan (forIndex Scan)

6. 1,667.938 98,751.741 ↓ 10.7 32 49,057

Unique (cost=1,556.90..1,556.91 rows=3 width=4) (actual time=1.965..2.013 rows=32 loops=49,057)

7. 3,483.047 97,083.803 ↓ 10.7 32 49,057

Sort (cost=1,556.90..1,556.90 rows=3 width=4) (actual time=1.963..1.979 rows=32 loops=49,057)

  • Sort Key: processodo4_.id_processo
  • Sort Method: quicksort Memory: 25kB
8. 4,163.010 93,600.756 ↓ 20.7 62 49,057

Nested Loop Semi Join (cost=1.29..1,556.87 rows=3 width=4) (actual time=0.175..1.908 rows=62 loops=49,057)

9. 19,959.299 80,355.366 ↓ 20.7 62 49,057

Nested Loop (cost=0.85..1,549.23 rows=3 width=8) (actual time=0.168..1.638 rows=62 loops=49,057)

10. 12,411.421 12,411.421 ↓ 2.1 326 49,057

Index Scan using idx_tb_sessao_processo_documento1 on tb_sessao_proc_documento sessaoproc3_ (cost=0.42..212.16 rows=158 width=4) (actual time=0.008..0.253 rows=326 loops=49,057)

  • Index Cond: ((id_sessao)::integer = (sessaopaut0_.id_sessao)::integer)
11. 47,984.646 47,984.646 ↓ 0.0 0 15,994,882

Index Scan using sys_c005812 on tb_processo_documento processodo4_ (cost=0.43..8.45 rows=1 width=12) (actual time=0.003..0.003 rows=0 loops=15,994,882)

  • Index Cond: ((id_processo_documento)::integer = sessaoproc3_.id_processo_documento)
  • Filter: (in_ativo AND ((id_tipo_processo_documento)::integer = 74))
  • Rows Removed by Filter: 1
12. 9,082.380 9,082.380 ↑ 1.0 1 3,027,460

Index Only Scan using idx_tb_processo_documento_bin_pessoa_assinatura1 on tb_proc_doc_bin_pess_assin processodo7_ (cost=0.43..2.71 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=3,027,460)

  • Index Cond: (id_processo_documento_bin = (processodo4_.id_processo_documento_bin)::integer)
  • Heap Fetches: 1610460
13. 30.895 1,533.060 ↓ 11.3 34 835

Unique (cost=1,549.26..1,549.27 rows=3 width=4) (actual time=1.783..1.836 rows=34 loops=835)

14. 40.915 1,502.165 ↓ 11.3 34 835

Sort (cost=1,549.26..1,549.26 rows=3 width=4) (actual time=1.781..1.799 rows=34 loops=835)

  • Sort Key: processodo10_.id_processo
  • Sort Method: quicksort Memory: 29kB
15. 293.604 1,461.250 ↓ 11.3 34 835

Nested Loop (cost=0.85..1,549.23 rows=3 width=4) (actual time=0.179..1.750 rows=34 loops=835)

16. 258.850 258.850 ↓ 2.3 363 835

Index Scan using idx_tb_sessao_processo_documento1 on tb_sessao_proc_documento sessaoproc9_ (cost=0.42..212.16 rows=158 width=4) (actual time=0.008..0.310 rows=363 loops=835)

  • Index Cond: ((id_sessao)::integer = (sessaopaut0_.id_sessao)::integer)
17. 908.796 908.796 ↓ 0.0 0 302,932

Index Scan using sys_c005812 on tb_processo_documento processodo10_ (cost=0.43..8.45 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=302,932)

  • Index Cond: ((id_processo_documento)::integer = sessaoproc9_.id_processo_documento)
  • Filter: (in_ativo AND ((id_tipo_processo_documento)::integer = 74))
  • Rows Removed by Filter: 1
18. 0.000 0.000 ↓ 0.0 0

Unique (cost=1,549.24..1,549.25 rows=1 width=4) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,549.24..1,549.25 rows=1 width=4) (never executed)

  • Sort Key: processodo14_.id_processo
20. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..1,549.23 rows=1 width=4) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_tb_sessao_processo_documento1 on tb_sessao_proc_documento sessaoproc13_ (cost=0.42..212.16 rows=158 width=4) (never executed)

  • Index Cond: ((id_sessao)::integer = (sessaopaut0_.id_sessao)::integer)
22. 0.000 0.000 ↓ 0.0 0

Index Scan using sys_c005812 on tb_processo_documento processodo14_ (cost=0.43..8.45 rows=1 width=8) (never executed)

  • Index Cond: ((id_processo_documento)::integer = sessaoproc13_.id_processo_documento)
  • Filter: (in_ativo AND ((id_tipo_processo_documento)::integer = 72))
23. 0.000 0.000 ↓ 0.0 0

Unique (cost=1,549.24..1,549.25 rows=2 width=4) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,549.24..1,549.25 rows=2 width=4) (never executed)

  • Sort Key: processodo18_.id_processo
25. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..1,549.23 rows=2 width=4) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_tb_sessao_processo_documento1 on tb_sessao_proc_documento sessaoproc17_ (cost=0.42..212.16 rows=158 width=4) (never executed)

  • Index Cond: ((id_sessao)::integer = (sessaopaut0_.id_sessao)::integer)
27. 0.000 0.000 ↓ 0.0 0

Index Scan using sys_c005812 on tb_processo_documento processodo18_ (cost=0.43..8.45 rows=1 width=8) (never executed)

  • Index Cond: ((id_processo_documento)::integer = sessaoproc17_.id_processo_documento)
  • Filter: (in_ativo AND ((id_tipo_processo_documento)::integer = 77))
28. 0.000 0.000 ↓ 0.0 0

Unique (cost=1,549.24..1,549.25 rows=2 width=4) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,549.24..1,549.25 rows=2 width=4) (never executed)

  • Sort Key: processodo22_.id_processo
30. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..1,549.23 rows=2 width=4) (never executed)

31. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_tb_sessao_processo_documento1 on tb_sessao_proc_documento sessaoproc21_ (cost=0.42..212.16 rows=158 width=4) (never executed)

  • Index Cond: ((id_sessao)::integer = (sessaopaut0_.id_sessao)::integer)
32. 0.000 0.000 ↓ 0.0 0

Index Scan using sys_c005812 on tb_processo_documento processodo22_ (cost=0.43..8.45 rows=1 width=8) (never executed)

  • Index Cond: ((id_processo_documento)::integer = sessaoproc21_.id_processo_documento)
  • Filter: (in_ativo AND ((id_tipo_processo_documento)::integer = 73))
33. 0.000 0.000 ↓ 0.0 0

Unique (cost=1,560.22..1,560.22 rows=1 width=4) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Sort (cost=1,560.22..1,560.22 rows=1 width=4) (never executed)

  • Sort Key: processodo26_.id_processo
35. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=1.29..1,560.21 rows=1 width=4) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..1,549.43 rows=5 width=8) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_tb_sessao_processo_documento1 on tb_sessao_proc_documento sessaoproc25_ (cost=0.42..212.16 rows=158 width=4) (never executed)

  • Index Cond: ((id_sessao)::integer = (sessaopaut0_.id_sessao)::integer)
38. 0.000 0.000 ↓ 0.0 0

Index Scan using sys_c005812 on tb_processo_documento processodo26_ (cost=0.43..8.45 rows=1 width=12) (never executed)

  • Index Cond: ((id_processo_documento)::integer = sessaoproc25_.id_processo_documento)
  • Filter: (in_ativo AND ((id_tipo_processo_documento)::integer = ANY ('{77,73,72}'::integer[])))
39. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_tb_processo_documento_bin_pessoa_assinatura1 on tb_proc_doc_bin_pess_assin processodo29_ (cost=0.43..2.26 rows=1 width=4) (never executed)

  • Index Cond: (id_processo_documento_bin = (processodo26_.id_processo_documento_bin)::integer)
  • Heap Fetches: 0
40. 1,007.384 1,009.515 ↓ 1.0 2,501 835

Materialize (cost=0.00..97.49 rows=2,498 width=8) (actual time=0.001..1.209 rows=2,501 loops=835)

41. 2.131 2.131 ↓ 1.0 2,501 1

Seq Scan on tb_sessao sessao1_ (cost=0.00..85.00 rows=2,498 width=8) (actual time=0.008..2.131 rows=2,501 loops=1)

  • Filter: (dt_fechamento_sessao IS NULL)
  • Rows Removed by Filter: 2