explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tYcI

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 650.976 ↑ 2.0 2 1

Limit (cost=10,685.31..10,685.32 rows=4 width=3,051) (actual time=650.975..650.976 rows=2 loops=1)

2. 0.034 650.974 ↑ 2.0 2 1

Sort (cost=10,685.31..10,685.32 rows=4 width=3,051) (actual time=650.973..650.974 rows=2 loops=1)

  • Sort Key: (COALESCE(round(((sum(produtosinterno.valorprodutoconvenio) - sum(produtosinterno.valorprodutoprestador))), 4), '0'::numeric))
  • Sort Method: quicksort Memory: 29kB
3. 0.139 650.940 ↑ 2.0 2 1

WindowAgg (cost=9,984.53..10,685.23 rows=4 width=3,051) (actual time=650.926..650.940 rows=2 loops=1)

4. 2.248 650.801 ↑ 2.0 2 1

Nested Loop Left Join (cost=9,984.53..10,684.90 rows=4 width=2,649) (actual time=628.218..650.801 rows=2 loops=1)

  • Join Filter: (operadoraoriginalcobrancaoriginal.id_multitenant = operadora_multitenant_cobrancaoriginal.id)
  • Rows Removed by Join Filter: 210
5.          

Initplan (for Nested Loop Left Join)

6. 0.048 0.048 ↑ 1.0 1 1

Seq Scan on fibocamposconfig (cost=0.00..4.38 rows=1 width=1) (actual time=0.020..0.048 rows=1 loops=1)

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 0.008 635.782 ↓ 2.0 2 1

Nested Loop Left Join (cost=9,880.15..10,186.51 rows=1 width=1,997) (actual time=619.781..635.782 rows=2 loops=1)

8. 0.035 635.770 ↓ 2.0 2 1

Nested Loop Left Join (cost=9,880.00..10,186.34 rows=1 width=1,957) (actual time=619.774..635.770 rows=2 loops=1)

  • Join Filter: (CASE WHEN ((sincronia_recursos_aceites_erp.recebimento_id IS NOT NULL) AND (recebimento.id IS NOT NULL)) THEN (sincronia_recursos_aceites_erp.recebimento_id = recebimento.id) ELSE true END AND (remessa.rem_numero = sincronia_recursos_aceites_erp.remessa))
9. 0.005 635.697 ↓ 2.0 2 1

Nested Loop Left Join (cost=9,879.71..10,186.00 rows=1 width=1,922) (actual time=619.725..635.697 rows=2 loops=1)

10. 0.004 635.690 ↓ 2.0 2 1

Nested Loop Left Join (cost=9,879.42..10,185.68 rows=1 width=1,852) (actual time=619.720..635.690 rows=2 loops=1)

11. 0.005 635.684 ↓ 2.0 2 1

Nested Loop Left Join (cost=9,879.00..10,185.21 rows=1 width=1,835) (actual time=619.717..635.684 rows=2 loops=1)

12. 0.134 635.677 ↓ 2.0 2 1

Hash Left Join (cost=9,878.71..10,184.89 rows=1 width=1,812) (actual time=619.712..635.677 rows=2 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadoraoriginalcobrancaoriginal.id)
  • Filter: (COALESCE(operadoraoriginalprestador.id, operadoraoriginalcobrancaoriginal.id, operadoraoriginalconvenio_1.id, '0'::bigint) = '36896823'::bigint)
  • Rows Removed by Filter: 72
13. 1.732 635.493 ↓ 1.5 74 1

Nested Loop Left Join (cost=9,874.37..10,179.81 rows=51 width=1,796) (actual time=37.029..635.493 rows=74 loops=1)

  • Join Filter: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.id)
  • Rows Removed by Join Filter: 7696
14. 0.346 626.287 ↓ 18.5 74 1

Nested Loop Left Join (cost=9,770.03..9,882.57 rows=4 width=1,804) (actual time=30.367..626.287 rows=74 loops=1)

15. 0.187 625.053 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,669.86..9,743.53 rows=1 width=1,724) (actual time=30.349..625.053 rows=74 loops=1)

16. 0.236 624.866 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,669.43..9,742.86 rows=1 width=1,654) (actual time=30.346..624.866 rows=74 loops=1)

17. 0.199 624.186 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,669.15..9,742.55 rows=1 width=1,650) (actual time=30.340..624.186 rows=74 loops=1)

18. 0.213 623.987 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,668.88..9,742.25 rows=1 width=1,617) (actual time=30.338..623.987 rows=74 loops=1)

19. 0.273 623.552 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,668.75..9,742.09 rows=1 width=1,574) (actual time=30.335..623.552 rows=74 loops=1)

20. 0.217 622.835 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,668.33..9,741.62 rows=1 width=1,540) (actual time=30.326..622.835 rows=74 loops=1)

21. 0.164 622.396 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,668.19..9,741.46 rows=1 width=1,527) (actual time=30.321..622.396 rows=74 loops=1)

22. 0.277 621.862 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,668.06..9,741.29 rows=1 width=1,514) (actual time=30.315..621.862 rows=74 loops=1)

23. 0.164 620.993 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,667.92..9,741.13 rows=1 width=1,498) (actual time=30.305..620.993 rows=74 loops=1)

24. 0.246 620.829 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,667.65..9,740.83 rows=1 width=1,455) (actual time=30.303..620.829 rows=74 loops=1)

25. 0.166 620.213 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,667.37..9,740.52 rows=1 width=1,437) (actual time=30.299..620.213 rows=74 loops=1)

26. 0.193 619.381 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,666.95..9,740.05 rows=1 width=1,405) (actual time=30.293..619.381 rows=74 loops=1)

27. 0.273 619.188 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,666.52..9,739.38 rows=1 width=1,407) (actual time=30.291..619.188 rows=74 loops=1)

28. 0.185 618.323 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,666.09..9,738.70 rows=1 width=1,383) (actual time=30.282..618.323 rows=74 loops=1)

29. 0.261 617.842 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,665.97..9,738.55 rows=1 width=1,340) (actual time=30.277..617.842 rows=74 loops=1)

30. 0.685 616.989 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,665.55..9,738.08 rows=1 width=1,340) (actual time=30.267..616.989 rows=74 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
31. 172.748 614.972 ↓ 18.5 74 1

Nested Loop Left Join (cost=9,665.12..9,704.24 rows=4 width=1,001) (actual time=30.253..614.972 rows=74 loops=1)

32. 0.150 27.158 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,564.95..9,565.20 rows=1 width=929) (actual time=23.773..27.158 rows=74 loops=1)

  • Join Filter: (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio)
33. 0.184 26.268 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,564.66..9,564.85 rows=1 width=918) (actual time=23.762..26.268 rows=74 loops=1)

34. 0.123 26.084 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,564.24..9,564.39 rows=1 width=896) (actual time=23.760..26.084 rows=74 loops=1)

35. 0.342 25.887 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,563.97..9,564.09 rows=1 width=863) (actual time=23.758..25.887 rows=74 loops=1)

36. 0.580 24.509 ↓ 74.0 74 1

Merge Left Join (cost=9,563.83..9,563.92 rows=1 width=850) (actual time=23.738..24.509 rows=74 loops=1)

  • Merge Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
37. 0.220 23.820 ↓ 74.0 74 1

Sort (cost=9,562.39..9,562.39 rows=1 width=837) (actual time=23.712..23.820 rows=74 loops=1)

  • Sort Key: guiaprestador.guistatusanaliseglosa
  • Sort Method: quicksort Memory: 100kB
38. 0.090 23.600 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,537.51..9,562.38 rows=1 width=837) (actual time=15.318..23.600 rows=74 loops=1)

39. 0.060 23.436 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,537.38..9,562.21 rows=1 width=821) (actual time=15.315..23.436 rows=74 loops=1)

40. 0.059 23.228 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,537.24..9,562.05 rows=1 width=805) (actual time=15.308..23.228 rows=74 loops=1)

41. 0.092 23.169 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,536.96..9,561.75 rows=1 width=762) (actual time=15.305..23.169 rows=74 loops=1)

42. 0.060 23.003 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,536.69..9,561.44 rows=1 width=744) (actual time=15.301..23.003 rows=74 loops=1)

43. 0.070 22.795 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,536.40..9,561.12 rows=1 width=694) (actual time=15.295..22.795 rows=74 loops=1)

44. 0.069 22.503 ↓ 74.0 74 1

Nested Loop Left Join (cost=9,535.98..9,560.65 rows=1 width=641) (actual time=15.286..22.503 rows=74 loops=1)

45. 0.337 22.212 ↓ 74.0 74 1

GroupAggregate (cost=9,535.55..9,552.18 rows=1 width=217) (actual time=15.278..22.212 rows=74 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
46. 0.105 15.215 ↓ 148.0 148 1

Sort (cost=9,535.55..9,535.55 rows=1 width=110) (actual time=15.195..15.215 rows=148 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 45kB
47. 0.057 15.110 ↓ 148.0 148 1

Subquery Scan on produtosinterno (cost=21.13..9,535.54 rows=1 width=110) (actual time=0.221..15.110 rows=148 loops=1)

48. 0.830 15.053 ↓ 148.0 148 1

Nested Loop Left Join (cost=21.13..9,535.53 rows=1 width=1,193) (actual time=0.220..15.053 rows=148 loops=1)

49. 0.170 9.191 ↓ 148.0 148 1

Nested Loop Left Join (cost=20.84..9,516.86 rows=1 width=174) (actual time=0.103..9.191 rows=148 loops=1)

50. 0.069 8.725 ↓ 148.0 148 1

Nested Loop (cost=20.41..9,514.71 rows=1 width=160) (actual time=0.096..8.725 rows=148 loops=1)

51. 0.140 8.360 ↓ 148.0 148 1

Nested Loop (cost=20.14..9,506.41 rows=1 width=168) (actual time=0.091..8.360 rows=148 loops=1)

52. 0.655 7.776 ↓ 5.7 148 1

Nested Loop (cost=19.71..9,450.12 rows=26 width=152) (actual time=0.083..7.776 rows=148 loops=1)

53. 1.077 2.709 ↓ 28.3 2,206 1

Nested Loop (cost=19.27..9,261.25 rows=78 width=98) (actual time=0.070..2.709 rows=2,206 loops=1)

54. 0.095 0.427 ↓ 60.2 241 1

Hash Join (cost=18.84..564.67 rows=4 width=25) (actual time=0.059..0.427 rows=241 loops=1)

  • Hash Cond: (guiaprestador_1.guicompetencia = competenciaprestador_1.id)
55. 0.298 0.298 ↓ 1.5 241 1

Index Scan using idx_fiboguia_guicompetenciaassoc_idx on fiboguia guiaprestador_1 (cost=0.43..545.61 rows=163 width=33) (actual time=0.020..0.298 rows=241 loops=1)

  • Index Cond: (guicompetenciaassoc = '315817989'::bigint)
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 228
56. 0.002 0.034 ↑ 1.0 22 1

Hash (cost=18.13..18.13 rows=22 width=8) (actual time=0.034..0.034 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
57. 0.021 0.032 ↑ 1.0 22 1

Bitmap Heap Scan on fibocompetencia competenciaprestador_1 (cost=4.45..18.13 rows=22 width=8) (actual time=0.015..0.032 rows=22 loops=1)

  • Recheck Cond: (comp_convenio = 'Embratel'::text)
  • Heap Blocks: exact=7
58. 0.011 0.011 ↑ 1.0 22 1

Bitmap Index Scan on idx_fibocompetencia_comp_convenio_idx (cost=0.00..4.44 rows=22 width=0) (actual time=0.011..0.011 rows=22 loops=1)

  • Index Cond: (comp_convenio = 'Embratel'::text)
59. 1.205 1.205 ↑ 75.0 9 241

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoprestador (cost=0.44..2,167.40 rows=675 width=81) (actual time=0.003..0.005 rows=9 loops=241)

  • Index Cond: (prodguia = guiaprestador_1.id)
60. 4.412 4.412 ↓ 0.0 0 2,206

Index Scan using fiboproduto_pkey on fiboproduto produtoconvenio (cost=0.44..2.41 rows=1 width=62) (actual time=0.002..0.002 rows=0 loops=2,206)

  • Index Cond: (id = produtoprestador.prodassoc)
  • Filter: ((COALESCE(prodvlrtotal, '0'::numeric) - COALESCE(produtoprestador.prodvlrtotal, '0'::numeric)) < '0'::numeric)
  • Rows Removed by Filter: 1
61. 0.444 0.444 ↑ 1.0 1 148

Index Scan using fiboguia_pkey on fiboguia guiaconvenio_1 (cost=0.43..2.15 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=148)

  • Index Cond: (id = produtoconvenio.prodguia)
  • Filter: ((guicompetencia = '315817989'::bigint) AND (guiorigem = 'CONVENIO'::text))
62. 0.296 0.296 ↑ 1.0 1 148

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio_1 (cost=0.28..8.29 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=148)

  • Index Cond: (id = '315817989'::bigint)
  • Filter: (comp_convenio = 'Embratel'::text)
63. 0.296 0.296 ↓ 0.0 0 148

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recursoproduto (cost=0.42..2.14 rows=1 width=30) (actual time=0.002..0.002 rows=0 loops=148)

  • Index Cond: (produtoprestador.id = rec_produto)
64. 0.000 0.000 ↓ 0.0 0 148

Index Only Scan using registro_envio_recurso_pkey on registro_envio_recurso registro_envio_item (cost=0.29..1.15 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=148)

  • Index Cond: (id = produtoprestador.registro_envio_recurso_id)
  • Heap Fetches: 0
65.          

SubPlan (for Nested Loop Left Join)

66. 3.552 5.032 ↑ 1.0 1 148

Aggregate (cost=17.48..17.49 rows=1 width=32) (actual time=0.034..0.034 rows=1 loops=148)

67. 0.110 1.480 ↑ 1.0 1 148

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=98) (actual time=0.009..0.010 rows=1 loops=148)

68. 0.091 1.036 ↑ 1.0 1 148

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=38) (actual time=0.006..0.007 rows=1 loops=148)

69. 0.444 0.444 ↑ 1.0 1 148

Index Scan using idx_fiboglosasproduto_id_produto_idx on fiboglosasproduto glosasproduto (cost=0.43..8.45 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=148)

  • Index Cond: (id_produto = produtoconvenio.id)
70. 0.501 0.501 ↑ 1.0 1 167

Index Scan using fiboglosa_pkey on fiboglosa glosas_1 (cost=0.43..8.45 rows=1 width=46) (actual time=0.003..0.003 rows=1 loops=167)

  • Index Cond: (id = glosasproduto.elt)
71. 0.334 0.334 ↑ 1.0 1 167

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo_1 (cost=0.29..0.31 rows=1 width=68) (actual time=0.002..0.002 rows=1 loops=167)

  • Index Cond: (id = glosas_1.glo_motivo)
72.          

SubPlan (for GroupAggregate)

73. 0.148 6.660 ↑ 1.0 1 148

Result (cost=16.55..16.56 rows=1 width=1) (actual time=0.045..0.045 rows=1 loops=148)

74.          

Initplan (for Result)

75. 6.512 6.512 ↓ 0.0 0 148

Seq Scan on anexo_recurso anexo_recurso_2 (cost=0.00..16.55 rows=1 width=0) (actual time=0.044..0.044 rows=0 loops=148)

  • Filter: ((entidade_id = produtosinterno.idprodutoprestador) AND (nivel = 'Produto'::text))
  • Rows Removed by Filter: 570
76. 0.222 0.222 ↑ 1.0 1 74

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=0.43..8.45 rows=1 width=433) (actual time=0.003..0.003 rows=1 loops=74)

  • Index Cond: (produtosinterno.idguiaprestador = id)
77. 0.222 0.222 ↑ 1.0 1 74

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioprestador (cost=0.42..0.46 rows=1 width=69) (actual time=0.003..0.003 rows=1 loops=74)

  • Index Cond: (guiaprestador.guibenefic = id)
78. 0.148 0.148 ↑ 1.0 1 74

Index Scan using fiboremessa_pkey on fiboremessa remessa (cost=0.29..0.31 rows=1 width=66) (actual time=0.002..0.002 rows=1 loops=74)

  • Index Cond: (guiaprestador.guiremessa = id)
79. 0.074 0.074 ↑ 1.0 1 74

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaprestador (cost=0.28..0.29 rows=1 width=26) (actual time=0.001..0.001 rows=1 loops=74)

  • Index Cond: (guiaprestador.guicompetencia = id)
80. 0.000 0.000 ↓ 0.0 0 74

Index Scan using fibodefinicaomotivoglosa_pkey on fibodefinicaomotivoglosa motivoglosaprestador (cost=0.28..0.29 rows=1 width=59) (actual time=0.000..0.000 rows=0 loops=74)

  • Index Cond: (guiaprestador.guimotglosa = id)
81. 0.148 0.148 ↑ 1.0 1 74

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoinicialprestador (cost=0.14..0.16 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=74)

  • Index Cond: (guiaprestador.guisituacaoguia = sitcodigo)
82. 0.074 0.074 ↑ 1.0 1 74

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoassociacaoprestador (cost=0.14..0.16 rows=1 width=30) (actual time=0.001..0.001 rows=1 loops=74)

  • Index Cond: (guiaprestador.guisituacaoguiaassoc = sitcodigo)
83. 0.103 0.109 ↓ 5.0 75 1

Sort (cost=1.44..1.48 rows=15 width=25) (actual time=0.023..0.109 rows=75 loops=1)

  • Sort Key: statusprestadoranalise.stcodigo
  • Sort Method: quicksort Memory: 26kB
84. 0.006 0.006 ↑ 1.0 15 1

Seq Scan on fibostatusguia statusprestadoranalise (cost=0.00..1.15 rows=15 width=25) (actual time=0.004..0.006 rows=15 loops=1)

85. 1.036 1.036 ↑ 1.0 1 74

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusprestadorconciliacao (cost=0.14..0.15 rows=1 width=25) (actual time=0.012..0.014 rows=1 loops=74)

  • Index Cond: (guiaprestador.guistatusconciliacao = stcodigo)
86. 0.074 0.074 ↓ 0.0 0 74

Index Scan using fiboprestador_pkey on fiboprestador prestadororiginalprestador (cost=0.28..0.30 rows=1 width=41) (actual time=0.001..0.001 rows=0 loops=74)

  • Index Cond: (guiaprestador.guiprestoriginal = id)
87. 0.000 0.000 ↓ 0.0 0 74

Index Scan using quitacao_sistema_gestao_pkey on quitacao_sistema_gestao (cost=0.42..0.44 rows=1 width=30) (actual time=0.000..0.000 rows=0 loops=74)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
88. 0.740 0.740 ↓ 0.0 0 74

Index Scan using idx_detalhes_quitacao_rpa_numero_remessa_idx on detalhes_quitacao_rpa (cost=0.28..0.34 rows=1 width=26) (actual time=0.010..0.010 rows=0 loops=74)

  • Index Cond: (remessa.rem_numero = numero_remessa)
89. 3.552 415.066 ↑ 4.0 1 74

Hash Right Join (cost=100.17..139.00 rows=4 width=80) (actual time=3.320..5.609 rows=1 loops=74)

  • Hash Cond: (operadora_multitenant_prestador.id = operadoraoriginalprestador.id_multitenant)
90. 410.108 410.108 ↑ 8.1 105 74

Foreign Scan on operadora_multitenant operadora_multitenant_prestador (cost=100.00..135.59 rows=853 width=72) (actual time=3.258..5.542 rows=105 loops=74)

91. 0.444 1.406 ↑ 1.0 1 74

Hash (cost=0.16..0.16 rows=1 width=24) (actual time=0.019..0.019 rows=1 loops=74)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
92. 0.962 0.962 ↑ 1.0 1 74

Index Scan using fibooperadora_pkey on fibooperadora operadoraoriginalprestador (cost=0.14..0.16 rows=1 width=24) (actual time=0.012..0.013 rows=1 loops=74)

  • Index Cond: (guiaprestador.guioperadoraoriginal = id)
93. 1.332 1.332 ↑ 1.0 1 74

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..8.45 rows=1 width=347) (actual time=0.017..0.018 rows=1 loops=74)

  • Index Cond: (produtosinterno.idguiaconvenio = id)
94. 0.592 0.592 ↑ 1.0 1 74

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloprestador (cost=0.42..0.46 rows=1 width=16) (actual time=0.008..0.008 rows=1 loops=74)

  • Index Cond: (guiaprestador.guiprotocolo = id)
95. 0.296 0.296 ↑ 1.0 1 74

Index Scan using fibohospital_pkey on fibohospital hospitalprestador (cost=0.12..0.14 rows=1 width=51) (actual time=0.003..0.004 rows=1 loops=74)

  • Index Cond: (protocoloprestador.hospital = id)
96. 0.592 0.592 ↑ 1.0 1 74

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia guiarecurso (cost=0.43..0.66 rows=1 width=32) (actual time=0.007..0.008 rows=1 loops=74)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
97. 0.000 0.000 ↓ 0.0 0 74

Index Scan using fiboguia_pkey on fiboguia guiapagamentorecurso (cost=0.43..0.66 rows=1 width=14) (actual time=0.000..0.000 rows=0 loops=74)

  • Index Cond: (id = guiarecurso.guiguiaassoc)
98. 0.666 0.666 ↑ 1.0 1 74

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=48) (actual time=0.008..0.009 rows=1 loops=74)

  • Index Cond: (guiaconvenio.guibenefic = id)
99. 0.370 0.370 ↑ 1.0 1 74

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio (cost=0.28..0.29 rows=1 width=26) (actual time=0.005..0.005 rows=1 loops=74)

  • Index Cond: (guiaconvenio.guicompetencia = id)
100. 0.000 0.000 ↓ 0.0 0 74

Index Scan using fibodefinicaomotivoglosa_pkey on fibodefinicaomotivoglosa motivoglosaconvenio (cost=0.28..0.29 rows=1 width=59) (actual time=0.000..0.000 rows=0 loops=74)

  • Index Cond: (guiaconvenio.guimotglosa = id)
101. 0.592 0.592 ↑ 1.0 1 74

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoconvenio (cost=0.14..0.16 rows=1 width=30) (actual time=0.008..0.008 rows=1 loops=74)

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
102. 0.370 0.370 ↑ 1.0 1 74

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioconciliacao (cost=0.14..0.15 rows=1 width=25) (actual time=0.004..0.005 rows=1 loops=74)

  • Index Cond: (guiaconvenio.guistatusconciliacao = stcodigo)
103. 0.222 0.222 ↑ 1.0 1 74

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioanalise (cost=0.14..0.15 rows=1 width=25) (actual time=0.003..0.003 rows=1 loops=74)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
104. 0.444 0.444 ↑ 1.0 1 74

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloconvenio (cost=0.42..0.46 rows=1 width=50) (actual time=0.006..0.006 rows=1 loops=74)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
105. 0.222 0.222 ↑ 1.0 1 74

Index Scan using fibohospital_pkey on fibohospital hospitalconvenio (cost=0.12..0.14 rows=1 width=51) (actual time=0.002..0.003 rows=1 loops=74)

  • Index Cond: (protocoloconvenio.hospital = id)
106. 0.000 0.000 ↓ 0.0 0 74

Index Scan using fiboprestador_pkey on fiboprestador prestadororiginalconvenio (cost=0.28..0.30 rows=1 width=41) (actual time=0.000..0.000 rows=0 loops=74)

  • Index Cond: (guiaconvenio.guiprestoriginal = id)
107. 0.444 0.444 ↑ 1.0 1 74

Index Scan using recebimento_pkey on recebimento (cost=0.28..0.30 rows=1 width=12) (actual time=0.005..0.006 rows=1 loops=74)

  • Index Cond: (guiaconvenio.recebimento_id = id)
108. 0.000 0.000 ↓ 0.0 0 74

Index Scan using fiboguia_pkey on fiboguia guiacobrancaoriginal (cost=0.43..0.66 rows=1 width=78) (actual time=0.000..0.000 rows=0 loops=74)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
109. 0.740 0.888 ↓ 0.0 0 74

Hash Join (cost=100.17..139.00 rows=4 width=80) (actual time=0.012..0.012 rows=0 loops=74)

  • Hash Cond: (operadora_multitenant_convenio_1.id = operadoraoriginalconvenio_1.id_multitenant)
110. 0.000 0.000 ↓ 0.0 0

Foreign Scan on operadora_multitenant operadora_multitenant_convenio_1 (cost=100.00..135.59 rows=853 width=72) (never executed)

111. 0.074 0.148 ↓ 0.0 0 74

Hash (cost=0.16..0.16 rows=1 width=24) (actual time=0.002..0.002 rows=0 loops=74)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
112. 0.074 0.074 ↓ 0.0 0 74

Index Scan using fibooperadora_pkey on fibooperadora operadoraoriginalconvenio_1 (cost=0.14..0.16 rows=1 width=24) (actual time=0.001..0.001 rows=0 loops=74)

  • Index Cond: (guiaconvenio.guioperadoraoriginal = id)
113. 0.838 7.474 ↑ 12.8 104 74

Materialize (cost=104.34..220.71 rows=1,331 width=8) (actual time=0.064..0.101 rows=104 loops=74)

114. 0.045 6.636 ↑ 12.8 104 1

Hash Right Join (cost=104.34..214.05 rows=1,331 width=8) (actual time=4.696..6.636 rows=104 loops=1)

  • Hash Cond: (operadora_multitenant_convenio.id = operadoraoriginalconvenio.id_multitenant)
115. 6.545 6.545 ↑ 24.4 105 1

Foreign Scan on operadora_multitenant operadora_multitenant_convenio (cost=100.00..186.80 rows=2,560 width=8) (actual time=4.639..6.545 rows=105 loops=1)

116. 0.019 0.046 ↑ 1.0 104 1

Hash (cost=3.04..3.04 rows=104 width=16) (actual time=0.046..0.046 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
117. 0.027 0.027 ↑ 1.0 104 1

Seq Scan on fibooperadora operadoraoriginalconvenio (cost=0.00..3.04 rows=104 width=16) (actual time=0.006..0.027 rows=104 loops=1)

118. 0.022 0.050 ↑ 1.0 104 1

Hash (cost=3.04..3.04 rows=104 width=24) (actual time=0.050..0.050 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
119. 0.028 0.028 ↑ 1.0 104 1

Seq Scan on fibooperadora operadoraoriginalcobrancaoriginal (cost=0.00..3.04 rows=104 width=24) (actual time=0.006..0.028 rows=104 loops=1)

120. 0.002 0.002 ↓ 0.0 0 2

Index Scan using fiboremessa_pkey on fiboremessa remessacobrancaoriginal (cost=0.29..0.31 rows=1 width=39) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (guiacobrancaoriginal.guiremessa = id)
121. 0.002 0.002 ↓ 0.0 0 2

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiariocobrancaoriginal (cost=0.42..0.46 rows=1 width=33) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
122. 0.002 0.002 ↓ 0.0 0 2

Index Scan using id_lote_recurso_pkey on lote_recurso (cost=0.29..0.31 rows=1 width=78) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
123. 0.038 0.038 ↑ 1.0 1 2

Index Scan using idx_sincronia_recursos_aceites_erp_numero_conta_idx on sincronia_recursos_aceites_erp (cost=0.29..0.32 rows=1 width=63) (actual time=0.017..0.019 rows=1 loops=2)

  • Index Cond: (guiaprestador.guinumconta = numero_conta)
  • Filter: CASE WHEN (guia_de_recurso IS TRUE) THEN (guiaprestador.discriminador = 'RECURSO'::text) ELSE (guiaprestador.discriminador = 'PRESTADOR'::text) END
124. 0.004 0.004 ↓ 0.0 0 2

Index Scan using idx_pendencia_guia_id_idx on pendencia (cost=0.15..0.17 rows=1 width=48) (actual time=0.002..0.002 rows=0 loops=2)

  • Index Cond: (guia_id = guiaprestador.id)
125. 12.380 12.380 ↑ 8.1 105 2

Foreign Scan on operadora_multitenant operadora_multitenant_cobrancaoriginal (cost=100.00..135.59 rows=853 width=72) (actual time=4.405..6.190 rows=105 loops=2)

126.          

SubPlan (for Nested Loop Left Join)

127. 0.000 0.000 ↓ 0.0 0

Seq Scan on anexo_recurso (cost=0.00..16.55 rows=1 width=0) (never executed)

  • Filter: ((entidade_id = guiaprestador.id) AND (nivel = 'Guia'::text))
128. 0.241 0.241 ↑ 1.0 565 1

Seq Scan on anexo_recurso anexo_recurso_1 (cost=0.00..15.12 rows=565 width=8) (actual time=0.018..0.241 rows=565 loops=1)

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
129. 0.020 0.020 ↓ 0.0 0 2

Index Only Scan using idx_fiboguia_id_guia_originaria_idx on fiboguia (cost=0.43..4.45 rows=1 width=0) (actual time=0.010..0.010 rows=0 loops=2)

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
130. 0.006 0.006 ↓ 0.0 0 2

Index Only Scan using idx_fiboguia_id_guia_originaria_idx on fiboguia fiboguia_1 (cost=0.43..4.45 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=2)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
131. 0.018 0.034 ↑ 1.0 1 2

Aggregate (cost=17.33..17.34 rows=1 width=32) (actual time=0.017..0.017 rows=1 loops=2)

132. 0.002 0.016 ↓ 0.0 0 2

Nested Loop Left Join (cost=1.00..17.08 rows=1 width=90) (actual time=0.008..0.008 rows=0 loops=2)

133. 0.004 0.014 ↓ 0.0 0 2

Nested Loop Left Join (cost=0.71..16.76 rows=1 width=38) (actual time=0.007..0.007 rows=0 loops=2)

134. 0.010 0.010 ↓ 0.0 0 2

Index Scan using idx_fiboglosasguia_id_guia_idx on fiboglosasguia glosasguia (cost=0.28..8.30 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=2)

  • Index Cond: (id_guia = guiaconvenio.id)
135. 0.000 0.000 ↓ 0.0 0

Index Scan using fiboglosa_pkey on fiboglosa glosas (cost=0.43..8.45 rows=1 width=46) (never executed)

  • Index Cond: (id = glosasguia.elt)
136. 0.000 0.000 ↓ 0.0 0

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo (cost=0.29..0.31 rows=1 width=68) (never executed)

  • Index Cond: (id = glosas.glo_motivo)
137. 0.006 0.018 ↑ 1.0 1 2

Aggregate (cost=8.44..8.45 rows=1 width=32) (actual time=0.009..0.009 rows=1 loops=2)

138. 0.012 0.012 ↓ 0.0 0 2

Index Scan using idx_espelhamento_site_convenio_guia_convenio_id_idx on espelhamento_site_convenio esp (cost=0.42..8.44 rows=1 width=15) (actual time=0.006..0.006 rows=0 loops=2)

  • Index Cond: (guia_convenio_id = guiaconvenio.id)
139. 0.000 0.002 ↓ 0.0 0 2

Index Scan using fiboguia_pkey on fiboguia fiboguia_3 (cost=8.87..16.89 rows=1 width=6) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (id = $11)
140.          

Initplan (for Index Scan)

141. 0.012 0.012 ↓ 0.0 0 2

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia fiboguia_2 (cost=0.43..8.45 rows=1 width=8) (actual time=0.005..0.006 rows=0 loops=2)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
142. 0.004 0.018 ↑ 1.0 1 2

Aggregate (cost=10.49..10.50 rows=1 width=32) (actual time=0.009..0.009 rows=1 loops=2)

143. 0.014 0.014 ↓ 0.0 0 2

Index Scan using idx_fiboguia_guicobrancaoriginal_idx on fiboguia pagrecurso (cost=0.43..10.49 rows=1 width=6) (actual time=0.007..0.007 rows=0 loops=2)

  • Index Cond: (guicobrancaoriginal = guiaprestador.id)
  • Filter: (guisituacaoguia = 'PosAuditoria'::text)
144. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_devolucao_guia_guia_devolvida_id_idx on devolucao_guia devolucao (cost=0.14..8.16 rows=1 width=0) (never executed)

  • Index Cond: (guia_devolvida_id = guiaprestador.id)
  • Heap Fetches: 0
145. 0.004 0.004 ↓ 0.0 0 1

Seq Scan on devolucao_guia devolucao_1 (cost=0.00..11.50 rows=150 width=8) (actual time=0.004..0.004 rows=0 loops=1)

Planning time : 38.120 ms
Execution time : 660.982 ms