explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R74U

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 484.841 91,757.643 ↓ 1.0 30,446 1

Hash Left Join (cost=71,251.99..3,443,052.45 rows=29,973 width=677) (actual time=4,635.077..91,757.643 rows=30,446 loops=1)

  • Hash Cond: (c.codigo = laudo.codigo_comunicacao_perda)
2. 308.695 37,267.044 ↓ 1.0 30,446 1

Hash Join (cost=66,945.61..199,375.32 rows=29,973 width=572) (actual time=4,238.858..37,267.044 rows=30,446 loops=1)

  • Hash Cond: (c.codigo_usuario_solicitacao = usuario.codigo)
3. 29.720 35,892.024 ↓ 1.0 30,446 1

Hash Join (cost=38,008.82..161,616.40 rows=29,973 width=553) (actual time=3,172.185..35,892.024 rows=30,446 loops=1)

  • Hash Cond: (p.codigo_safra = safra.codigo)
4. 36.067 35,851.948 ↓ 1.0 30,446 1

Nested Loop (cost=38,006.59..161,202.05 rows=29,973 width=549) (actual time=3,161.799..35,851.948 rows=30,446 loops=1)

5. 54.516 30,822.737 ↓ 1.0 30,446 1

Nested Loop (cost=38,006.17..144,147.60 rows=29,973 width=526) (actual time=3,161.755..30,822.737 rows=30,446 loops=1)

6. 26.562 10,795.645 ↓ 1.0 30,446 1

Hash Join (cost=38,005.75..128,992.51 rows=29,973 width=526) (actual time=3,156.540..10,795.645 rows=30,446 loops=1)

  • Hash Cond: (p.codigo_modelo = modelo.codigo)
7. 25.464 10,639.527 ↓ 1.0 30,446 1

Hash Join (cost=37,506.27..128,080.91 rows=29,973 width=275) (actual time=3,026.963..10,639.527 rows=30,446 loops=1)

  • Hash Cond: (p.codigo_cooperativa = empresa_cresol.codigo)
8. 28.274 10,541.633 ↓ 1.0 30,446 1

Hash Join (cost=35,805.56..125,968.07 rows=29,973 width=261) (actual time=2,954.197..10,541.633 rows=30,446 loops=1)

  • Hash Cond: (ende.codigo_cidade = cidade.codigo)
9. 53.395 10,353.421 ↓ 1.0 30,446 1

Nested Loop (cost=34,529.22..124,279.51 rows=29,998 width=147) (actual time=2,794.200..10,353.421 rows=30,446 loops=1)

10. 54.257 9,569.322 ↑ 1.0 30,446 1

Nested Loop (cost=34,528.80..106,959.33 rows=30,446 width=147) (actual time=2,782.537..9,569.322 rows=30,446 loops=1)

11. 156.476 9,362.835 ↑ 1.0 30,446 1

Hash Join (cost=34,528.37..88,934.01 rows=30,446 width=116) (actual time=2,782.493..9,362.835 rows=30,446 loops=1)

  • Hash Cond: (p.codigo = c.codigo_proposta)
12. 6,431.611 6,431.611 ↓ 1.0 368,322 1

Seq Scan on comercial_emprestimo_proposta p (cost=0.00..51,799.19 rows=368,319 width=32) (actual time=7.552..6,431.611 rows=368,322 loops=1)

13. 26.086 2,774.748 ↑ 1.0 30,446 1

Hash (cost=34,147.80..34,147.80 rows=30,446 width=88) (actual time=2,774.748..2,774.748 rows=30,446 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 3725kB
14. 140.733 2,748.662 ↑ 1.0 30,446 1

Hash Join (cost=2,002.04..34,147.80 rows=30,446 width=88) (actual time=152.980..2,748.662 rows=30,446 loops=1)

  • Hash Cond: (mutuario.codigo = c.codigo_mutuario)
15. 2,470.809 2,470.809 ↑ 1.0 368,703 1

Seq Scan on comercial_emprestimo_mutuario mutuario (cost=0.00..29,536.57 rows=368,757 width=8) (actual time=15.201..2,470.809 rows=368,703 loops=1)

16. 19.358 137.120 ↑ 1.0 30,446 1

Hash (cost=1,621.46..1,621.46 rows=30,446 width=88) (actual time=137.120..137.120 rows=30,446 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 3725kB
17. 117.762 117.762 ↑ 1.0 30,446 1

Seq Scan on comercial_emprestimo_comunicacao_perda_proago c (cost=0.00..1,621.46 rows=30,446 width=88) (actual time=13.173..117.762 rows=30,446 loops=1)

18. 152.230 152.230 ↑ 1.0 1 30,446

Index Scan using estrutura_entidade_pkey on estrutura_entidade coop (cost=0.42..0.58 rows=1 width=31) (actual time=0.005..0.005 rows=1 loops=30,446)

  • Index Cond: (codigo = p.codigo_cooperativa)
19. 730.704 730.704 ↑ 1.0 1 30,446

Index Scan using estrutura_endereco_pkey on estrutura_endereco ende (cost=0.43..0.56 rows=1 width=8) (actual time=0.024..0.024 rows=1 loops=30,446)

  • Index Cond: (codigo = coop.codigo_endereco)
20. 2.158 159.938 ↑ 1.0 5,565 1

Hash (cost=1,206.78..1,206.78 rows=5,565 width=122) (actual time=159.938..159.938 rows=5,565 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 321kB
21. 3.013 157.780 ↑ 1.0 5,565 1

Hash Join (cost=1.61..1,206.78 rows=5,565 width=122) (actual time=22.639..157.780 rows=5,565 loops=1)

  • Hash Cond: (cidade.codigo_estado = estado.codigo)
22. 144.419 144.419 ↑ 1.0 5,565 1

Seq Scan on estrutura_cidade cidade (cost=0.00..1,128.65 rows=5,565 width=8) (actual time=12.266..144.419 rows=5,565 loops=1)

23. 0.018 10.348 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=122) (actual time=10.348..10.348 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
24. 10.330 10.330 ↑ 1.0 27 1

Seq Scan on estrutura_estado estado (cost=0.00..1.27 rows=27 width=122) (actual time=10.325..10.330 rows=27 loops=1)

25. 15.502 72.430 ↑ 1.0 50,876 1

Hash (cost=1,064.76..1,064.76 rows=50,876 width=22) (actual time=72.430..72.430 rows=50,876 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3292kB
26. 56.928 56.928 ↑ 1.0 50,876 1

Seq Scan on estrutura_empresa empresa_cresol (cost=0.00..1,064.76 rows=50,876 width=22) (actual time=0.006..56.928 rows=50,876 loops=1)

27. 0.253 129.556 ↓ 1.0 247 1

Hash (cost=496.40..496.40 rows=246 width=259) (actual time=129.556..129.556 rows=247 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
28. 0.292 129.303 ↓ 1.0 247 1

Hash Join (cost=375.95..496.40 rows=246 width=259) (actual time=71.634..129.303 rows=247 loops=1)

  • Hash Cond: (leiaute.codigo_banco = banco.codigo)
29. 0.399 124.407 ↓ 1.0 247 1

Nested Loop (cost=374.55..491.61 rows=246 width=45) (actual time=67.013..124.407 rows=247 loops=1)

30. 0.251 57.071 ↓ 1.0 247 1

Hash Join (cost=374.26..385.10 rows=246 width=12) (actual time=56.688..57.071 rows=247 loops=1)

  • Hash Cond: (modelo.codigo_leiaute_linha_credito = leiaute.codigo)
31. 10.315 10.315 ↓ 1.0 247 1

Seq Scan on comercial_emprestimo_modelo modelo (cost=0.00..7.46 rows=246 width=8) (actual time=10.126..10.315 rows=247 loops=1)

32. 1.759 46.505 ↑ 1.0 4,945 1

Hash (cost=312.45..312.45 rows=4,945 width=12) (actual time=46.505..46.505 rows=4,945 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 277kB
33. 44.746 44.746 ↑ 1.0 4,945 1

Seq Scan on comercial_emprestimo_leiaute_linha_credito leiaute (cost=0.00..312.45 rows=4,945 width=12) (actual time=8.455..44.746 rows=4,945 loops=1)

34. 66.937 66.937 ↑ 1.0 1 247

Index Scan using comercial_emprestimo_linha_credito_abstract_pkey on comercial_emprestimo_linha_credito_abstract linha (cost=0.28..0.42 rows=1 width=41) (actual time=0.271..0.271 rows=1 loops=247)

  • Index Cond: (codigo = leiaute.codigo_linha_credito)
35. 0.023 4.604 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=222) (actual time=4.604..4.604 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
36. 4.581 4.581 ↑ 1.0 18 1

Seq Scan on estrutura_banco banco (cost=0.00..1.18 rows=18 width=222) (actual time=4.576..4.581 rows=18 loops=1)

37. 19,972.576 19,972.576 ↑ 1.0 1 30,446

Index Scan using estrutura_conta_cooperado_pkey on estrutura_conta_cooperado conta (cost=0.42..0.50 rows=1 width=8) (actual time=0.656..0.656 rows=1 loops=30,446)

  • Index Cond: (codigo = mutuario.codigo_conta_cooperado)
38. 4,993.144 4,993.144 ↑ 1.0 1 30,446

Index Scan using estrutura_entidade_pkey on estrutura_entidade cooperado (cost=0.42..0.56 rows=1 width=27) (actual time=0.163..0.164 rows=1 loops=30,446)

  • Index Cond: (codigo = conta.codigo_cooperado)
39. 0.011 10.356 ↑ 1.0 10 1

Hash (cost=2.10..2.10 rows=10 width=12) (actual time=10.356..10.356 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
40. 10.345 10.345 ↑ 1.0 10 1

Seq Scan on comercial_emprestimo_safra safra (cost=0.00..2.10 rows=10 width=12) (actual time=10.328..10.345 rows=10 loops=1)

41. 270.622 1,066.325 ↑ 1.0 604,962 1

Hash (cost=17,238.13..17,238.13 rows=605,013 width=27) (actual time=1,066.325..1,066.325 rows=604,962 loops=1)

  • Buckets: 65536 Batches: 16 Memory Usage: 2773kB
42. 795.703 795.703 ↑ 1.0 604,962 1

Seq Scan on estrutura_entidade usuario (cost=0.00..17,238.13 rows=605,013 width=27) (actual time=7.661..795.703 rows=604,962 loops=1)

43. 8.805 268.568 ↓ 1.0 16,403 1

Hash (cost=4,101.35..4,101.35 rows=16,402 width=109) (actual time=268.568..268.568 rows=16,403 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1456kB
44. 10.706 259.763 ↓ 1.0 16,403 1

Hash Right Join (cost=1,126.22..4,101.35 rows=16,402 width=109) (actual time=69.100..259.763 rows=16,403 loops=1)

  • Hash Cond: (su_atual.codigo_laudo_pericial_atual = laudo.codigo)
45. 22.488 214.470 ↑ 1.0 15,642 1

Hash Right Join (cost=512.17..3,273.02 rows=15,741 width=109) (actual time=34.355..214.470 rows=15,642 loops=1)

  • Hash Cond: (su.codigo = su_atual.codigo_sumula_ultimo_julgamento)
46. 165.030 165.030 ↑ 1.0 34,103 1

Seq Scan on proagroonline_sumula_julgamento su (cost=0.00..2,476.17 rows=34,117 width=109) (actual time=7.303..165.030 rows=34,103 loops=1)

47. 4.445 26.952 ↑ 1.0 15,642 1

Hash (cost=315.41..315.41 rows=15,741 width=8) (actual time=26.952..26.952 rows=15,642 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 738kB
48. 22.507 22.507 ↑ 1.0 15,642 1

Seq Scan on proagroonline_sumula_julgamento_atual su_atual (cost=0.00..315.41 rows=15,741 width=8) (actual time=0.007..22.507 rows=15,642 loops=1)

49. 4.742 34.587 ↓ 1.0 16,403 1

Hash (cost=409.02..409.02 rows=16,402 width=8) (actual time=34.587..34.587 rows=16,403 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 897kB
50. 29.845 29.845 ↓ 1.0 16,403 1

Seq Scan on proagroonline_laudo_pericial_atual laudo (cost=0.00..409.02 rows=16,402 width=8) (actual time=10.422..29.845 rows=16,403 loops=1)

51.          

SubPlan (forHash Left Join)

52. 608.920 608.920 ↑ 1.0 1 30,446

Index Scan using estrutura_entidade_pkey on estrutura_entidade (cost=0.42..8.44 rows=1 width=23) (actual time=0.020..0.020 rows=1 loops=30,446)

  • Index Cond: (codigo = c.codigo_assistencia_tecnica)
53. 334.906 334.906 ↑ 1.0 1 30,446

Index Scan using estrutura_entidade_pkey on estrutura_entidade estrutura_entidade_1 (cost=0.42..8.44 rows=1 width=23) (actual time=0.011..0.011 rows=1 loops=30,446)

  • Index Cond: (codigo = c.codigo_tecnico_agronomo)
54. 20,459.712 20,459.712 ↑ 1.0 1 30,446

Index Scan using estrutura_pessoa_pkey on estrutura_pessoa (cost=0.42..8.44 rows=1 width=54) (actual time=0.672..0.672 rows=1 loops=30,446)

  • Index Cond: (codigo = conta.codigo_cooperado)
55. 0.000 0.000 ↓ 0.0 0

Index Scan using empresa_pkey on estrutura_empresa (cost=0.29..8.31 rows=1 width=18) (never executed)

  • Index Cond: (codigo = conta.codigo_cooperado)
56. 0.000 31,328.934 ↑ 1.0 1 30,446

Limit (cost=0.70..16.74 rows=1 width=4) (actual time=1.029..1.029 rows=1 loops=30,446)

57. 91.338 31,328.934 ↑ 1.0 1 30,446

Nested Loop (cost=0.70..16.74 rows=1 width=4) (actual time=1.029..1.029 rows=1 loops=30,446)

58. 31,085.366 31,085.366 ↑ 1.0 1 30,446

Index Scan using comercial_emprestimo_empreendimento_proposta_id1 on comercial_emprestimo_empreendimento_proposta empr_prop (cost=0.42..8.44 rows=1 width=4) (actual time=1.021..1.021 rows=1 loops=30,446)

  • Index Cond: (codigo_proposta = c.codigo_proposta)
59. 152.230 152.230 ↑ 1.0 1 30,446

Index Only Scan using comercial_emprestimo_empreendimento_pkey on comercial_emprestimo_empreendimento empr (cost=0.28..8.29 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=30,446)

  • Index Cond: (codigo = empr_prop.codigo_empreendimento)
  • Heap Fetches: 30446
60. 30.446 274.014 ↑ 1.0 1 30,446

Limit (cost=0.70..16.74 rows=1 width=38) (actual time=0.008..0.009 rows=1 loops=30,446)

61. 60.892 243.568 ↑ 1.0 1 30,446

Nested Loop (cost=0.70..16.74 rows=1 width=38) (actual time=0.008..0.008 rows=1 loops=30,446)

62. 121.784 121.784 ↑ 1.0 1 30,446

Index Scan using comercial_emprestimo_empreendimento_proposta_id1 on comercial_emprestimo_empreendimento_proposta empr_prop_1 (cost=0.42..8.44 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=30,446)

  • Index Cond: (codigo_proposta = c.codigo_proposta)
63. 60.892 60.892 ↑ 1.0 1 30,446

Index Scan using comercial_emprestimo_empreendimento_pkey on comercial_emprestimo_empreendimento empr_1 (cost=0.28..8.29 rows=1 width=42) (actual time=0.002..0.002 rows=1 loops=30,446)

  • Index Cond: (codigo = empr_prop_1.codigo_empreendimento)
64. 60.892 730.704 ↑ 2.0 1 30,446

Append (cost=0.98..40.93 rows=2 width=23) (actual time=0.014..0.024 rows=1 loops=30,446)

65. 60.892 456.690 ↑ 1.0 1 30,446

Nested Loop (cost=0.98..17.06 rows=1 width=23) (actual time=0.014..0.015 rows=1 loops=30,446)

  • Join Filter: (empresa.codigo_empresa_pai = emp_base.codigo)
66. 30.446 304.460 ↑ 1.0 1 30,446

Nested Loop (cost=0.70..16.75 rows=1 width=31) (actual time=0.010..0.010 rows=1 loops=30,446)

67. 152.230 152.230 ↑ 1.0 1 30,446

Index Scan using empresa_cresol_pkey on estrutura_empresa_cresol empresa (cost=0.28..8.29 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=30,446)

  • Index Cond: (codigo = coop.codigo)
68. 121.784 121.784 ↑ 1.0 1 30,446

Index Scan using estrutura_entidade_pkey on estrutura_entidade enti (cost=0.42..8.44 rows=1 width=27) (actual time=0.003..0.004 rows=1 loops=30,446)

  • Index Cond: (codigo = empresa.codigo_empresa_pai)
69. 91.338 91.338 ↑ 1.0 1 30,446

Index Scan using empresa_cresol_pkey on estrutura_empresa_cresol emp_base (cost=0.28..0.30 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=30,446)

  • Index Cond: (codigo = enti.codigo)
  • Filter: (codigo_grupo_empresa = 2)
  • Rows Removed by Filter: 0
70. 0.000 213.122 ↓ 0.0 0 30,446

Nested Loop (cost=1.26..23.85 rows=1 width=23) (actual time=0.007..0.007 rows=0 loops=30,446)

  • Join Filter: (emp_pai.codigo_empresa_pai = emp_base_1.codigo)
71. 0.000 213.122 ↓ 0.0 0 30,446

Nested Loop (cost=0.98..23.54 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=30,446)

72. 30.446 213.122 ↓ 0.0 0 30,446

Nested Loop (cost=0.56..16.60 rows=1 width=4) (actual time=0.006..0.007 rows=0 loops=30,446)

73. 91.338 91.338 ↑ 1.0 1 30,446

Index Scan using empresa_cresol_pkey on estrutura_empresa_cresol empresa_1 (cost=0.28..8.29 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=30,446)

  • Index Cond: (codigo = coop.codigo)
74. 91.338 91.338 ↓ 0.0 0 30,446

Index Scan using empresa_cresol_pkey on estrutura_empresa_cresol emp_pai (cost=0.28..8.30 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=30,446)

  • Index Cond: (codigo = empresa_1.codigo_empresa_pai)
  • Filter: (codigo_grupo_empresa <> 2)
  • Rows Removed by Filter: 1
75. 1.545 1.545 ↑ 1.0 1 515

Index Scan using estrutura_entidade_pkey on estrutura_entidade enti_1 (cost=0.42..6.93 rows=1 width=27) (actual time=0.003..0.003 rows=1 loops=515)

  • Index Cond: (codigo = emp_pai.codigo_empresa_pai)
76. 1.545 1.545 ↑ 1.0 1 515

Index Scan using empresa_cresol_pkey on estrutura_empresa_cresol emp_base_1 (cost=0.28..0.30 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=515)

  • Index Cond: (codigo = enti_1.codigo)
  • Filter: (codigo_grupo_empresa = 2)
Planning time : 1,564.737 ms
Execution time : 91,764.334 ms