explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fdh1

Settings
# exclusive inclusive rows x rows loops node
1. 0.036 362.284 ↑ 1.0 50 1

Limit (cost=93.72..119,046.81 rows=50 width=1,596) (actual time=286.123..362.284 rows=50 loops=1)

2. 0.180 362.248 ↑ 114.8 50 1

Subquery Scan on dados_guias (cost=93.72..13,653,529.15 rows=5,739 width=1,596) (actual time=286.123..362.248 rows=50 loops=1)

3. 4.045 362.068 ↑ 114.8 50 1

Nested Loop Left Join (cost=93.72..13,653,270.89 rows=5,739 width=1,623) (actual time=286.109..362.068 rows=50 loops=1)

4. 0.043 311.673 ↑ 114.8 50 1

Nested Loop Left Join (cost=80.13..12,888,215.82 rows=5,739 width=1,175) (actual time=279.149..311.673 rows=50 loops=1)

5. 0.051 299.880 ↑ 114.8 50 1

Nested Loop Left Join (cost=64.87..12,800,495.21 rows=5,739 width=1,155) (actual time=277.095..299.880 rows=50 loops=1)

6. 0.031 288.129 ↑ 114.8 50 1

Nested Loop Left Join (cost=49.61..12,712,731.55 rows=5,739 width=1,091) (actual time=275.130..288.129 rows=50 loops=1)

7. 0.044 272.998 ↑ 114.8 50 1

Nested Loop Left Join (cost=35.20..12,629,831.70 rows=5,739 width=1,051) (actual time=270.189..272.998 rows=50 loops=1)

8. 0.059 272.954 ↑ 114.8 50 1

Nested Loop Left Join (cost=34.92..12,628,080.14 rows=5,739 width=1,047) (actual time=270.187..272.954 rows=50 loops=1)

  • Join Filter: (protocolo_prestador.hospital = hospital.id)
9. 0.047 272.895 ↑ 114.8 50 1

Nested Loop Left Join (cost=34.92..12,627,993.05 rows=5,739 width=977) (actual time=270.177..272.895 rows=50 loops=1)

10. 0.052 272.848 ↑ 114.8 50 1

Nested Loop Left Join (cost=34.50..12,623,425.59 rows=5,739 width=977) (actual time=270.175..272.848 rows=50 loops=1)

11. 0.043 272.646 ↑ 114.8 50 1

Nested Loop Left Join (cost=34.07..12,618,858.13 rows=5,739 width=977) (actual time=270.160..272.646 rows=50 loops=1)

12. 0.045 272.453 ↑ 114.8 50 1

Nested Loop Left Join (cost=33.65..12,616,021.33 rows=5,739 width=969) (actual time=270.144..272.453 rows=50 loops=1)

13. 0.038 272.408 ↑ 114.8 50 1

Nested Loop Left Join (cost=33.23..12,613,299.59 rows=5,739 width=950) (actual time=270.142..272.408 rows=50 loops=1)

14. 0.044 272.370 ↑ 114.8 50 1

Nested Loop Left Join (cost=32.81..12,610,589.61 rows=5,739 width=897) (actual time=270.141..272.370 rows=50 loops=1)

15. 0.047 272.326 ↑ 114.8 50 1

Nested Loop Left Join (cost=32.53..12,608,853.23 rows=5,739 width=889) (actual time=270.138..272.326 rows=50 loops=1)

  • Join Filter: (remessa.rem_numero = sincronia.remessa)
  • Rows Removed by Join Filter: 6
16. 4.983 271.929 ↑ 114.8 50 1

Nested Loop (cost=32.24..12,606,911.54 rows=5,739 width=847) (actual time=270.124..271.929 rows=50 loops=1)

  • Join Filter: (guia_prestador.guioperadoraoriginal = operadoraoriginal_prestador.operadora_id)
  • Rows Removed by Join Filter: 12291
17. 6.895 266.946 ↑ 56.3 12,341 1

Merge Join (cost=32.24..12,596,486.23 rows=694,601 width=839) (actual time=0.137..266.946 rows=12,341 loops=1)

  • Merge Cond: (remessa.id = guia_prestador.guiremessa)
18. 0.543 0.543 ↑ 64.1 892 1

Index Scan using fiboremessa_pkey on fiboremessa remessa (cost=0.29..4,764.37 rows=57,213 width=41) (actual time=0.006..0.543 rows=892 loops=1)

19. 10.203 259.508 ↑ 56.3 12,341 1

Materialize (cost=31.78..22,991,425.85 rows=694,601 width=806) (actual time=0.126..259.508 rows=12,341 loops=1)

20. 9.438 249.305 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=31.78..22,989,689.35 rows=694,601 width=806) (actual time=0.121..249.305 rows=12,341 loops=1)

21. 10.528 215.185 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=31.36..22,648,946.90 rows=694,601 width=753) (actual time=0.105..215.185 rows=12,341 loops=1)

22. 9.738 204.657 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=31.21..22,527,347.72 rows=694,601 width=617) (actual time=0.103..204.657 rows=12,341 loops=1)

23. 6.915 170.237 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=30.79..22,208,041.78 rows=694,601 width=565) (actual time=0.102..170.237 rows=12,341 loops=1)

24. 7.222 163.322 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=30.50..21,984,502.46 rows=694,601 width=545) (actual time=0.101..163.322 rows=12,341 loops=1)

25. 7.145 156.100 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=30.21..21,763,108.15 rows=694,601 width=525) (actual time=0.084..156.100 rows=12,341 loops=1)

26. 7.335 148.955 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=29.79..21,429,443.34 rows=694,601 width=525) (actual time=0.073..148.955 rows=12,341 loops=1)

27. 9.641 141.620 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=29.36..20,960,190.20 rows=694,601 width=511) (actual time=0.057..141.620 rows=12,341 loops=1)

28. 6.672 119.638 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=28.94..20,367,466.75 rows=694,601 width=466) (actual time=0.049..119.638 rows=12,341 loops=1)

29. 13.341 112.966 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=28.66..20,155,567.46 rows=694,601 width=441) (actual time=0.048..112.966 rows=12,341 loops=1)

30. 8.975 74.943 ↑ 56.3 12,341 1

Nested Loop Left Join (cost=1.27..1,112,947.36 rows=694,601 width=433) (actual time=0.042..74.943 rows=12,341 loops=1)

31. 6.484 65.968 ↑ 56.3 12,341 1

Nested Loop (cost=0.84..520,223.91 rows=694,601 width=308) (actual time=0.028..65.968 rows=12,341 loops=1)

32. 13.845 34.802 ↑ 56.3 12,341 1

Nested Loop (cost=0.70..371,001.47 rows=694,601 width=271) (actual time=0.018..34.802 rows=12,341 loops=1)

33. 8.616 8.616 ↑ 56.3 12,341 1

Index Scan using idx_fiboguia_guiremessa_idx on fiboguia guia_prestador (cost=0.43..160,812.67 rows=694,601 width=253) (actual time=0.008..8.616 rows=12,341 loops=1)

  • Filter: (guiorigem = 'HOSPITAL'::text)
34. 12.341 12.341 ↑ 1.0 1 12,341

Index Scan using fibocompetencia_pkey on fibocompetencia competencia_prestador (cost=0.28..0.29 rows=1 width=26) (actual time=0.001..0.001 rows=1 loops=12,341)

  • Index Cond: (id = guia_prestador.guicompetencia)
35. 24.682 24.682 ↑ 1.0 1 12,341

Index Scan using fiboconvenio_convnome_unique on fiboconvenio convenio (cost=0.14..0.20 rows=1 width=47) (actual time=0.001..0.002 rows=1 loops=12,341)

  • Index Cond: (convnome = competencia_prestador.comp_convenio)
36. 0.000 0.000 ↓ 0.0 0 12,341

Index Scan using fiboguia_pkey on fiboguia guia_convenio (cost=0.43..0.84 rows=1 width=133) (actual time=0.000..0.000 rows=0 loops=12,341)

  • Index Cond: (guia_prestador.guiguiaassoc = id)
37. 0.000 24.682 ↑ 1.0 1 12,341

Aggregate (cost=27.39..27.40 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=12,341)

38. 7.970 24.682 ↓ 0.0 0 12,341

Nested Loop (cost=0.85..27.38 rows=2 width=8) (actual time=0.002..0.002 rows=0 loops=12,341)

39. 12.341 12.341 ↓ 0.0 0 12,341

Index Scan using idx_fiboguia_guicobrancaoriginal_idx on fiboguia guia_pagamento_vinculada (cost=0.43..10.48 rows=2 width=8) (actual time=0.001..0.001 rows=0 loops=12,341)

  • Index Cond: (guia_prestador.id = guicobrancaoriginal)
40. 4.371 4.371 ↑ 1.0 1 1,457

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocolo_pagamento (cost=0.42..8.44 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1,457)

  • Index Cond: (id = guia_pagamento_vinculada.guiprotocolo)
41. 0.000 0.000 ↓ 0.0 0 12,341

Index Scan using fiboprestador_pkey on fiboprestador prestador (cost=0.28..0.30 rows=1 width=41) (actual time=0.000..0.000 rows=0 loops=12,341)

  • Index Cond: (guia_convenio.guiprestoriginal = id)
42. 12.341 12.341 ↓ 0.0 0 12,341

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia guia_recurso (cost=0.43..0.84 rows=1 width=53) (actual time=0.001..0.001 rows=0 loops=12,341)

  • Index Cond: (guia_prestador.id = guiidguiaprestador)
43. 0.000 0.000 ↓ 0.0 0 12,341

Index Scan using fiboguia_pkey on fiboguia guia_pagamento_recurso (cost=0.43..0.67 rows=1 width=30) (actual time=0.000..0.000 rows=0 loops=12,341)

  • Index Cond: (id = guia_recurso.guiguiaassoc)
  • Filter: (guistatusconciliacao = 'Fechada'::text)
44. 0.000 0.000 ↓ 0.0 0 12,341

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocolo_pagamento_recurso (cost=0.42..0.47 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=12,341)

  • Index Cond: (id = guia_pagamento_recurso.guiprotocolo)
45. 0.000 0.000 ↓ 0.0 0 12,341

Index Scan using id_lote_recurso_pkey on lote_recurso (cost=0.29..0.31 rows=1 width=28) (actual time=0.000..0.000 rows=0 loops=12,341)

  • Index Cond: (id = guia_recurso.id_lote_recurso)
46. 0.000 0.000 ↓ 0.0 0 12,341

Index Scan using id_lote_recurso_pkey on lote_recurso lote_recurso_se_guia_for_de_recurso (cost=0.29..0.31 rows=1 width=28) (actual time=0.000..0.000 rows=0 loops=12,341)

  • Index Cond: (id = guia_prestador.id_lote_recurso)
47. 24.682 24.682 ↑ 1.0 1 12,341

Index Scan using quitacao_sistema_gestao_pkey on quitacao_sistema_gestao (cost=0.42..0.45 rows=1 width=60) (actual time=0.002..0.002 rows=1 loops=12,341)

  • Index Cond: (guia_prestador.gui_quitacao_sistema_gestao = id)
48. 0.000 0.000 ↓ 0.0 0 12,341

Index Scan using idx_pendencia_guia_id_idx on pendencia (cost=0.15..0.17 rows=1 width=144) (actual time=0.000..0.000 rows=0 loops=12,341)

  • Index Cond: (guia_id = guia_prestador.id)
49. 24.682 24.682 ↑ 1.0 1 12,341

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiario_prestador (cost=0.42..0.48 rows=1 width=69) (actual time=0.002..0.002 rows=1 loops=12,341)

  • Index Cond: (guia_prestador.guibenefic = id)
50. 0.000 0.000 ↑ 1.0 1 12,341

Materialize (cost=0.00..6.30 rows=1 width=16) (actual time=0.000..0.000 rows=1 loops=12,341)

51. 0.035 0.035 ↑ 1.0 1 1

Seq Scan on view_smartdata_operadoras operadoraoriginal_prestador (cost=0.00..6.30 rows=1 width=16) (actual time=0.032..0.035 rows=1 loops=1)

  • Filter: (operadora_grupo_id = 40825)
  • Rows Removed by Filter: 103
52. 0.350 0.350 ↓ 0.0 0 50

Index Scan using idx_sincronia_recursos_aceites_erp_numero_conta_idx on sincronia_recursos_aceites_erp sincronia (cost=0.29..0.33 rows=1 width=58) (actual time=0.007..0.007 rows=0 loops=50)

  • Index Cond: (guia_prestador.guinumconta = numero_conta)
  • Filter: CASE WHEN (guia_de_recurso IS TRUE) THEN (guia_prestador.discriminador = 'RECURSO'::text) ELSE (guia_prestador.discriminador = 'PRESTADOR'::text) END
53. 0.000 0.000 ↓ 0.0 0 50

Index Scan using fibocompetencia_pkey on fibocompetencia competencia_convenio (cost=0.28..0.29 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (guia_convenio.guicompetencia = id)
54. 0.000 0.000 ↓ 0.0 0 50

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiario_convenio (cost=0.42..0.46 rows=1 width=69) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (guia_convenio.guibenefic = id)
55. 0.000 0.000 ↓ 0.0 0 50

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocolo_convenio (cost=0.42..0.46 rows=1 width=35) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (guia_convenio.guiprotocolo = id)
56. 0.150 0.150 ↑ 1.0 1 50

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocolo_prestador (cost=0.42..0.48 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=50)

  • Index Cond: (guia_prestador.guiprotocolo = id)
57. 0.150 0.150 ↑ 1.0 1 50

Index Scan using fiboarquivo_pkey on fiboarquivo arquivo_prestador (cost=0.42..0.79 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=50)

  • Index Cond: (protocolo_prestador.arquivo = id)
58. 0.000 0.000 ↓ 0.0 0 50

Index Scan using fiboarquivo_pkey on fiboarquivo arquivo_convenio (cost=0.42..0.79 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (protocolo_convenio.arquivo = id)
59. 0.000 0.000 ↑ 1.0 1 50

Materialize (cost=0.00..1.01 rows=1 width=78) (actual time=0.000..0.000 rows=1 loops=50)

60. 0.004 0.004 ↑ 1.0 1 1

Seq Scan on fibohospital hospital (cost=0.00..1.01 rows=1 width=78) (actual time=0.004..0.004 rows=1 loops=1)

61. 0.000 0.000 ↓ 0.0 0 50

Index Scan using recebimento_pkey on recebimento (cost=0.28..0.30 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (guia_convenio.recebimento_id = id)
62. 0.100 15.100 ↑ 1.0 1 50

Aggregate (cost=14.41..14.42 rows=1 width=40) (actual time=0.302..0.302 rows=1 loops=50)

63. 15.000 15.000 ↓ 0.0 0 50

Function Scan on guia_totais_todos_recursos todos_recursos (cost=0.25..12.75 rows=333 width=28) (actual time=0.300..0.300 rows=0 loops=50)

  • Filter: (id > guia_recurso.id)
64. 0.050 11.700 ↑ 1.0 1 50

Aggregate (cost=15.26..15.27 rows=1 width=64) (actual time=0.234..0.234 rows=1 loops=50)

65. 11.650 11.650 ↓ 0.0 0 50

Function Scan on guia_totais_todos_recursos todos_recursos_1 (cost=0.25..15.25 rows=2 width=40) (actual time=0.233..0.233 rows=0 loops=50)

  • Filter: ((id > guia_recurso.id) AND (status_conciliacao = 'Fechada'::text))
66. 0.050 11.750 ↓ 0.0 0 50

Limit (cost=15.26..15.27 rows=1 width=28) (actual time=0.235..0.235 rows=0 loops=50)

67. 0.100 11.700 ↓ 0.0 0 50

Sort (cost=15.26..15.27 rows=1 width=28) (actual time=0.234..0.234 rows=0 loops=50)

  • Sort Key: todos_recursos_2.idx_recurso DESC
  • Sort Method: quicksort Memory: 25kB
68. 11.600 11.600 ↓ 0.0 0 50

Function Scan on guia_totais_todos_recursos todos_recursos_2 (cost=0.25..15.25 rows=1 width=28) (actual time=0.232..0.232 rows=0 loops=50)

  • Filter: (associado AND (id >= guia_recurso.id) AND (status_conciliacao = 'Fechada'::text))
69. 0.000 11.500 ↓ 0.0 0 50

Limit (cost=13.59..13.59 rows=1 width=189) (actual time=0.230..0.230 rows=0 loops=50)

70. 0.100 11.500 ↓ 0.0 0 50

Sort (cost=13.59..14.00 rows=167 width=189) (actual time=0.230..0.230 rows=0 loops=50)

  • Sort Key: todos_recursos_3.idx_recurso DESC
  • Sort Method: quicksort Memory: 25kB
71. 11.400 11.400 ↓ 0.0 0 50

Function Scan on guia_totais_todos_recursos todos_recursos_3 (cost=0.25..12.75 rows=167 width=189) (actual time=0.228..0.228 rows=0 loops=50)

  • Filter: (associado AND (id >= guia_recurso.id))
72.          

SubPlan (forNested Loop Left Join)

73. 0.050 0.200 ↑ 1.0 1 50

Result (cost=8.45..8.46 rows=1 width=1) (actual time=0.004..0.004 rows=1 loops=50)

74.          

Initplan (forResult)

75. 0.150 0.150 ↓ 0.0 0 50

Index Scan using idx_historico_alteracao_status_guia_guia_status_novo_idx on historico_alteracao_status_guia hist (cost=0.43..8.45 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=50)

  • Index Cond: ((guia = guia_prestador.id) AND (status_novo IS NULL))
  • Filter: ((status_anterior IS NOT NULL) AND (discriminador = 'ANALISE_DE_GLOSA'::text))
76. 0.000 0.200 ↓ 0.0 0 50

Limit (cost=8.46..8.47 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=50)

77. 0.100 0.200 ↓ 0.0 0 50

Sort (cost=8.46..8.47 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=50)

  • Sort Key: hist_1.data_alteracao DESC
  • Sort Method: quicksort Memory: 25kB
78. 0.100 0.100 ↓ 0.0 0 50

Index Scan using idx_historico_alteracao_status_guia_guia_status_novo_idx on historico_alteracao_status_guia hist_1 (cost=0.43..8.45 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=50)

  • Index Cond: ((guia = guia_prestador.id) AND (status_novo = 'Fechada'::text))
  • Filter: ((status_anterior IS NOT NULL) AND (discriminador = 'CONCILIACAO'::text))
79. 0.050 0.300 ↑ 1.0 1 50

Limit (cost=9.23..9.23 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=50)

80. 0.050 0.250 ↑ 4.0 1 50

Sort (cost=9.23..9.24 rows=4 width=8) (actual time=0.005..0.005 rows=1 loops=50)

  • Sort Key: hist_2.data_alteracao DESC
  • Sort Method: quicksort Memory: 25kB
81. 0.200 0.200 ↑ 4.0 1 50

Index Scan using idx_historico_alteracao_status_guia_guia_idx on historico_alteracao_status_guia hist_2 (cost=0.43..9.21 rows=4 width=8) (actual time=0.003..0.004 rows=1 loops=50)

  • Index Cond: (guia = guia_prestador.id)
  • Filter: (discriminador = 'CONCILIACAO'::text)
82. 0.050 0.200 ↑ 1.0 1 50

Limit (cost=9.23..9.23 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=50)

83. 0.050 0.150 ↑ 4.0 1 50

Sort (cost=9.23..9.24 rows=4 width=16) (actual time=0.003..0.003 rows=1 loops=50)

  • Sort Key: hist_3.data_alteracao DESC
  • Sort Method: quicksort Memory: 25kB
84. 0.100 0.100 ↑ 4.0 1 50

Index Scan using idx_historico_alteracao_status_guia_guia_idx on historico_alteracao_status_guia hist_3 (cost=0.43..9.21 rows=4 width=16) (actual time=0.002..0.002 rows=1 loops=50)

  • Index Cond: (guia = guia_prestador.id)
  • Filter: (discriminador = 'CONCILIACAO'::text)
85. 0.000 0.150 ↑ 1.0 1 50

Limit (cost=9.23..9.23 rows=1 width=9) (actual time=0.003..0.003 rows=1 loops=50)

86. 0.050 0.150 ↑ 4.0 1 50

Sort (cost=9.23..9.24 rows=4 width=9) (actual time=0.003..0.003 rows=1 loops=50)

  • Sort Key: hist_4.data_alteracao DESC
  • Sort Method: quicksort Memory: 25kB
87. 0.100 0.100 ↑ 4.0 1 50

Index Scan using idx_historico_alteracao_status_guia_guia_idx on historico_alteracao_status_guia hist_4 (cost=0.43..9.21 rows=4 width=9) (actual time=0.002..0.002 rows=1 loops=50)

  • Index Cond: (guia = guia_prestador.id)
  • Filter: (discriminador = 'CONCILIACAO'::text)
88. 0.000 0.050 ↓ 0.0 0 50

Limit (cost=9.22..9.23 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=50)

89. 0.050 0.050 ↓ 0.0 0 50

Sort (cost=9.22..9.23 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=50)

  • Sort Key: hist_5.data_alteracao DESC
  • Sort Method: quicksort Memory: 25kB
90. 0.000 0.000 ↓ 0.0 0 50

Result (cost=0.43..9.21 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=50)

  • One-Time Filter: (guia_prestador.guistatusanaliseglosa = 'Analisada'::text)
91. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_historico_alteracao_status_guia_guia_idx on historico_alteracao_status_guia hist_5 (cost=0.43..9.21 rows=1 width=8) (never executed)

  • Index Cond: (guia = guia_prestador.id)
  • Filter: (discriminador = 'ANALISE_DE_GLOSA'::text)
92. 0.000 0.050 ↓ 0.0 0 50

Limit (cost=9.22..9.23 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=50)

93. 0.050 0.050 ↓ 0.0 0 50

Sort (cost=9.22..9.23 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=50)

  • Sort Key: hist_6.data_alteracao DESC
  • Sort Method: quicksort Memory: 25kB
94. 0.000 0.000 ↓ 0.0 0 50

Result (cost=0.43..9.21 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=50)

  • One-Time Filter: (guia_prestador.guistatusanaliseglosa = 'Analisada'::text)
95. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_historico_alteracao_status_guia_guia_idx on historico_alteracao_status_guia hist_6 (cost=0.43..9.21 rows=1 width=16) (never executed)

  • Index Cond: (guia = guia_prestador.id)
  • Filter: (discriminador = 'ANALISE_DE_GLOSA'::text)
96. 0.050 0.200 ↑ 1.0 1 50

Aggregate (cost=10.49..10.50 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=50)

97. 0.150 0.150 ↓ 0.0 0 50

Index Scan using idx_fiboguia_guicobrancaoriginal_idx on fiboguia guia_pagamento_recurso_avulso (cost=0.43..10.49 rows=1 width=6) (actual time=0.003..0.003 rows=0 loops=50)

  • Index Cond: (guicobrancaoriginal = guia_prestador.id)
  • Filter: (guisituacaoguia = ANY ('{PagamentoDeRecurso,PagamentoDeRecursoAntigo}'::text[]))
98. 0.050 12.000 ↑ 1.0 1 50

Aggregate (cost=12.76..12.77 rows=1 width=8) (actual time=0.240..0.240 rows=1 loops=50)

99. 11.950 11.950 ↓ 0.0 0 50

Function Scan on guia_totais_todos_recursos (cost=0.25..12.75 rows=5 width=8) (actual time=0.239..0.239 rows=0 loops=50)

  • Filter: (id = guia_prestador.id)
100. 0.050 11.650 ↑ 1.0 1 50

Aggregate (cost=15.26..15.27 rows=1 width=32) (actual time=0.232..0.233 rows=1 loops=50)

101. 11.600 11.600 ↓ 0.0 0 50

Function Scan on guia_totais_todos_recursos guia_totais_todos_recursos_1 (cost=0.25..15.25 rows=2 width=20) (actual time=0.232..0.232 rows=0 loops=50)

  • Filter: ((id > guia_recurso.id) AND (status_analise = 'Analisada'::text))
102. 0.050 9.850 ↑ 1.0 1 50

Aggregate (cost=17.75..17.77 rows=1 width=32) (actual time=0.197..0.197 rows=1 loops=50)

103. 9.800 9.800 ↓ 0.0 0 50

Function Scan on guia_totais_todos_recursos guia_totais_todos_recursos_2 (cost=0.25..17.75 rows=2 width=20) (actual time=0.196..0.196 rows=0 loops=50)

  • Filter: ((id > guia_recurso.id) AND (status_analise <> 'Analisada'::text) AND (status_conciliacao = 'Fechada'::text))
Planning time : 53.071 ms
Execution time : 363.859 ms