explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mI5c

Settings
# exclusive inclusive rows x rows loops node
1. 0.044 1,771.139 ↓ 100.0 100 1

Limit (cost=121,388.10..121,388.10 rows=1 width=3,051) (actual time=1,771.081..1,771.139 rows=100 loops=1)

2. 5.269 1,771.095 ↓ 100.0 100 1

Sort (cost=121,388.10..121,388.10 rows=1 width=3,051) (actual time=1,771.080..1,771.095 rows=100 loops=1)

  • Sort Key: (COALESCE(round(((sum(produtosinterno.valorprodutoconvenio) - sum(produtosinterno.valorprodutoprestador))), 4), '0'::numeric))
  • Sort Method: top-N heapsort Memory: 226kB
3. 20.020 1,765.826 ↓ 1,519.0 1,519 1

WindowAgg (cost=121,238.71..121,388.08 rows=1 width=3,051) (actual time=1,759.212..1,765.826 rows=1,519 loops=1)

4. 42.087 1,745.806 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,238.71..121,387.99 rows=1 width=2,649) (actual time=1,463.251..1,745.806 rows=1,519 loops=1)

5.          

Initplan (forNested Loop Left Join)

6. 0.028 0.028 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 3.665 1,676.099 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,234.18..121,296.50 rows=1 width=2,013) (actual time=1,462.051..1,676.099 rows=1,519 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))
8. 1.779 1,648.130 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,233.89..121,296.16 rows=1 width=1,978) (actual time=1,461.650..1,648.130 rows=1,519 loops=1)

9. 1.848 1,637.237 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,233.60..121,295.84 rows=1 width=1,908) (actual time=1,461.336..1,637.237 rows=1,519 loops=1)

10. 1.918 1,635.389 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,233.46..121,295.67 rows=1 width=1,836) (actual time=1,461.333..1,635.389 rows=1,519 loops=1)

11. 2.027 1,633.471 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,233.03..121,295.20 rows=1 width=1,819) (actual time=1,461.329..1,633.471 rows=1,519 loops=1)

12. 1.517 1,631.444 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,232.74..121,294.88 rows=1 width=1,796) (actual time=1,461.325..1,631.444 rows=1,519 loops=1)

13. 1.988 1,628.408 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,232.32..121,294.21 rows=1 width=1,726) (actual time=1,461.321..1,628.408 rows=1,519 loops=1)

14. 1.690 1,621.863 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,232.04..121,293.90 rows=1 width=1,722) (actual time=1,461.061..1,621.863 rows=1,519 loops=1)

15. 1.473 1,617.135 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,231.90..121,293.73 rows=1 width=1,650) (actual time=1,461.054..1,617.135 rows=1,519 loops=1)

16. 1.133 1,611.105 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,231.62..121,293.43 rows=1 width=1,617) (actual time=1,461.042..1,611.105 rows=1,519 loops=1)

17. 2.713 1,606.934 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,231.49..121,293.27 rows=1 width=1,574) (actual time=1,461.034..1,606.934 rows=1,519 loops=1)

18. 1.655 1,593.588 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,231.07..121,292.80 rows=1 width=1,540) (actual time=1,460.670..1,593.588 rows=1,519 loops=1)

19. 2.213 1,588.895 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.94..121,292.64 rows=1 width=1,527) (actual time=1,460.666..1,588.895 rows=1,519 loops=1)

20. 2.345 1,583.644 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.80..121,292.47 rows=1 width=1,514) (actual time=1,460.661..1,583.644 rows=1,519 loops=1)

21. 1.916 1,576.742 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.66..121,292.31 rows=1 width=1,498) (actual time=1,460.655..1,576.742 rows=1,519 loops=1)

22. 1.808 1,574.826 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.39..121,292.01 rows=1 width=1,455) (actual time=1,460.652..1,574.826 rows=1,519 loops=1)

23. 1.328 1,568.461 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.11..121,291.70 rows=1 width=1,437) (actual time=1,460.647..1,568.461 rows=1,519 loops=1)

24. 1.981 1,536.753 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,229.69..121,291.23 rows=1 width=1,405) (actual time=1,460.631..1,536.753 rows=1,519 loops=1)

25. 2.462 1,534.772 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,229.26..121,290.56 rows=1 width=1,407) (actual time=1,460.627..1,534.772 rows=1,519 loops=1)

26. 1.597 1,526.234 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,228.84..121,289.89 rows=1 width=1,383) (actual time=1,460.415..1,526.234 rows=1,519 loops=1)

27. 4.044 1,521.599 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,228.71..121,289.73 rows=1 width=1,340) (actual time=1,460.408..1,521.599 rows=1,519 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
  • Rows Removed by Filter: 1
28. 1.969 1,511.475 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=121,228.28..121,264.35 rows=3 width=1,001) (actual time=1,460.393..1,511.475 rows=1,520 loops=1)

29. 0.918 1,488.226 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=121,227.86..121,262.93 rows=3 width=1,001) (actual time=1,460.098..1,488.226 rows=1,520 loops=1)

30. 1.316 1,481.228 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=121,227.44..121,261.57 rows=3 width=979) (actual time=1,460.095..1,481.228 rows=1,520 loops=1)

31. 1.527 1,476.872 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=121,227.30..121,261.06 rows=3 width=907) (actual time=1,460.088..1,476.872 rows=1,520 loops=1)

32. 1.424 1,475.345 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=121,227.02..121,260.14 rows=3 width=874) (actual time=1,460.085..1,475.345 rows=1,520 loops=1)

33. 1.812 1,470.881 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=121,226.89..121,259.66 rows=3 width=861) (actual time=1,460.081..1,470.881 rows=1,520 loops=1)

34. 3.343 1,464.509 ↓ 506.7 1,520 1

Merge Left Join (cost=121,226.75..121,259.17 rows=3 width=848) (actual time=1,460.072..1,464.509 rows=1,520 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
35. 6.053 1,448.814 ↓ 506.7 1,520 1

Sort (cost=120,376.85..120,376.85 rows=3 width=837) (actual time=1,447.874..1,448.814 rows=1,520 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 1587kB
36. 0.565 1,442.761 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=120,298.31..120,376.82 rows=3 width=837) (actual time=1,065.155..1,442.761 rows=1,520 loops=1)

37. 1.545 1,439.156 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=120,298.17..120,376.33 rows=3 width=821) (actual time=1,065.148..1,439.156 rows=1,520 loops=1)

38. 1.187 1,434.571 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=120,298.03..120,375.83 rows=3 width=805) (actual time=1,065.133..1,434.571 rows=1,520 loops=1)

39. 0.635 1,433.384 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=120,297.76..120,374.92 rows=3 width=762) (actual time=1,065.130..1,433.384 rows=1,520 loops=1)

40. 1.759 1,429.709 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=120,297.48..120,374.02 rows=3 width=744) (actual time=1,065.118..1,429.709 rows=1,520 loops=1)

41. 1.231 1,420.350 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=120,297.19..120,373.05 rows=3 width=694) (actual time=1,064.670..1,420.350 rows=1,520 loops=1)

42. 2.100 1,393.279 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=120,296.77..120,371.63 rows=3 width=641) (actual time=1,064.653..1,393.279 rows=1,520 loops=1)

43. 12.533 1,382.059 ↓ 506.7 1,520 1

GroupAggregate (cost=120,296.34..120,346.24 rows=3 width=217) (actual time=1,064.143..1,382.059 rows=1,520 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
44. 5.280 1,065.191 ↓ 2,254.3 6,763 1

Sort (cost=120,296.34..120,296.35 rows=3 width=110) (actual time=1,064.009..1,065.191 rows=6,763 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 1144kB
45. 2.692 1,059.911 ↓ 2,254.3 6,763 1

Subquery Scan on produtosinterno (cost=269.75..120,296.32 rows=3 width=110) (actual time=44.411..1,059.911 rows=6,763 loops=1)

46. 44.505 1,057.219 ↓ 2,254.3 6,763 1

Nested Loop Left Join (cost=269.75..120,296.29 rows=3 width=1,193) (actual time=44.409..1,057.219 rows=6,763 loops=1)

47. 3.983 776.009 ↓ 2,254.3 6,763 1

Nested Loop Left Join (cost=269.46..120,240.28 rows=3 width=174) (actual time=44.233..776.009 rows=6,763 loops=1)

48. 1.853 751.737 ↓ 2,254.3 6,763 1

Nested Loop (cost=269.03..120,233.84 rows=3 width=160) (actual time=44.216..751.737 rows=6,763 loops=1)

49. 0.013 0.013 ↑ 1.0 1 1

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

  • Index Cond: (id = '329678849'::bigint)
  • Filter: (comp_convenio = 'SulAmerica'::text)
50. 3.063 749.871 ↓ 2,254.3 6,763 1

Nested Loop (cost=268.76..120,225.51 rows=3 width=168) (actual time=44.201..749.871 rows=6,763 loops=1)

51. 21.573 719.756 ↓ 11.1 6,763 1

Nested Loop (cost=268.33..118,902.70 rows=611 width=152) (actual time=43.950..719.756 rows=6,763 loops=1)

52. 27.143 346.295 ↓ 24.0 43,986 1

Nested Loop (cost=267.89..114,464.36 rows=1,833 width=98) (actual time=43.346..346.295 rows=43,986 loops=1)

53. 1.277 72.672 ↓ 60.2 6,320 1

Nested Loop (cost=267.45..7,620.87 rows=105 width=25) (actual time=42.345..72.672 rows=6,320 loops=1)

54. 0.048 0.072 ↑ 1.0 23 1

Bitmap Heap Scan on fibocompetencia competenciaprestador_1 (cost=4.45..17.74 rows=23 width=8) (actual time=0.029..0.072 rows=23 loops=1)

  • Recheck Cond: (comp_convenio = 'SulAmerica'::text)
  • Heap Blocks: exact=8
55. 0.024 0.024 ↑ 1.0 23 1

Bitmap Index Scan on idx_fibocompetencia_comp_convenio_idx (cost=0.00..4.45 rows=23 width=0) (actual time=0.024..0.024 rows=23 loops=1)

  • Index Cond: (comp_convenio = 'SulAmerica'::text)
56. 8.970 71.323 ↓ 55.0 275 23

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=263.00..330.52 rows=5 width=33) (actual time=2.834..3.101 rows=275 loops=23)

  • Recheck Cond: ((guicompetencia = competenciaprestador_1.id) AND (guicompetenciaassoc = '329678849'::bigint))
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 259
  • Heap Blocks: exact=1605
57. 3.036 62.353 ↓ 0.0 0 23

BitmapAnd (cost=263.00..263.00 rows=17 width=0) (actual time=2.711..2.711 rows=0 loops=23)

58. 35.995 35.995 ↓ 5.8 10,233 23

Bitmap Index Scan on idx_fiboguia_guicompetencia_idx (cost=0.00..33.42 rows=1,755 width=0) (actual time=1.565..1.565 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
59. 23.322 23.322 ↓ 1.0 12,278 23

Bitmap Index Scan on idx_fiboguia_guicompetenciaassoc_idx (cost=0.00..228.42 rows=12,265 width=0) (actual time=1.014..1.014 rows=12,278 loops=23)

  • Index Cond: (guicompetenciaassoc = '329678849'::bigint)
60. 246.480 246.480 ↑ 96.4 7 6,320

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoprestador (cost=0.44..1,010.81 rows=675 width=81) (actual time=0.028..0.039 rows=7 loops=6,320)

  • Index Cond: (prodguia = guiaprestador_1.id)
61. 351.888 351.888 ↓ 0.0 0 43,986

Index Scan using fiboproduto_pkey on fiboproduto produtoconvenio (cost=0.44..2.41 rows=1 width=62) (actual time=0.008..0.008 rows=0 loops=43,986)

  • Index Cond: (id = produtoprestador.prodassoc)
  • Filter: ((COALESCE(prodvlrtotal, '0'::numeric) - COALESCE(produtoprestador.prodvlrtotal, '0'::numeric)) < '0'::numeric)
  • Rows Removed by Filter: 1
62. 27.052 27.052 ↑ 1.0 1 6,763

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

  • Index Cond: (id = produtoconvenio.prodguia)
  • Filter: ((guicompetencia = '329678849'::bigint) AND (guiorigem = 'CONVENIO'::text))
63. 20.289 20.289 ↑ 1.0 1 6,763

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recursoproduto (cost=0.42..2.14 rows=1 width=30) (actual time=0.003..0.003 rows=1 loops=6,763)

  • Index Cond: (produtoprestador.id = rec_produto)
64. 6.763 6.763 ↓ 0.0 0 6,763

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.001..0.001 rows=0 loops=6,763)

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

SubPlan (forNested Loop Left Join)

66. 155.549 229.942 ↑ 1.0 1 6,763

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

67. 13.478 74.393 ↑ 1.0 1 6,763

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=98) (actual time=0.010..0.011 rows=1 loops=6,763)

68. 6.691 47.341 ↑ 1.0 1 6,763

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=38) (actual time=0.007..0.007 rows=1 loops=6,763)

69. 20.289 20.289 ↑ 1.0 1 6,763

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=6,763)

  • Index Cond: (id_produto = produtoconvenio.id)
70. 20.361 20.361 ↑ 1.0 1 6,787

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=6,787)

  • Index Cond: (id = glosasproduto.elt)
71. 13.574 13.574 ↑ 1.0 1 6,787

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=6,787)

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

SubPlan (forGroupAggregate)

73. 6.763 304.335 ↑ 1.0 1 6,763

Result (cost=16.55..16.56 rows=1 width=1) (actual time=0.045..0.045 rows=1 loops=6,763)

74.          

Initplan (forResult)

75. 297.572 297.572 ↓ 0.0 0 6,763

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=6,763)

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

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

  • Index Cond: (produtosinterno.idguiaprestador = id)
77. 25.840 25.840 ↑ 1.0 1 1,520

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

  • Index Cond: (guiaprestador.guibenefic = id)
78. 7.600 7.600 ↑ 1.0 1 1,520

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

  • Index Cond: (guiaprestador.guiremessa = id)
79. 3.040 3.040 ↑ 1.0 1 1,520

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

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

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=1,520)

  • Index Cond: (guiaprestador.guimotglosa = id)
81. 3.040 3.040 ↑ 1.0 1 1,520

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=1,520)

  • Index Cond: (guiaprestador.guisituacaoguia = sitcodigo)
82. 3.040 3.040 ↑ 1.0 1 1,520

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

  • Index Cond: (guiaprestador.guisituacaoguiaassoc = sitcodigo)
83. 10.233 12.352 ↑ 5.4 806 1

Sort (cost=849.90..860.70 rows=4,318 width=26) (actual time=12.168..12.352 rows=806 loops=1)

  • Sort Key: detalhes_quitacao_rpa.numero_remessa, detalhes_quitacao_rpa.nome_convenio
  • Sort Method: quicksort Memory: 500kB
84. 2.119 2.119 ↑ 1.0 4,318 1

Seq Scan on detalhes_quitacao_rpa (cost=0.00..589.18 rows=4,318 width=26) (actual time=0.006..2.119 rows=4,318 loops=1)

85. 4.560 4.560 ↑ 1.0 1 1,520

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

  • Index Cond: (guiaprestador.guistatusconciliacao = stcodigo)
86. 3.040 3.040 ↑ 1.0 1 1,520

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusprestadoranalise (cost=0.14..0.15 rows=1 width=25) (actual time=0.001..0.002 rows=1 loops=1,520)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
87. 0.000 0.000 ↓ 0.0 0 1,520

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

  • Index Cond: (guiaprestador.guiprestoriginal = id)
88. 3.040 3.040 ↑ 1.0 1 1,520

Index Scan using idx_view_smartdata_operadoras_operadora_id_idx on view_smartdata_operadoras operadoraoriginalprestador (cost=0.14..0.16 rows=1 width=80) (actual time=0.001..0.002 rows=1 loops=1,520)

  • Index Cond: (guiaprestador.guioperadoraoriginal = operadora_id)
89. 6.080 6.080 ↓ 0.0 0 1,520

Index Scan using quitacao_sistema_gestao_pkey on quitacao_sistema_gestao (cost=0.42..0.44 rows=1 width=30) (actual time=0.003..0.004 rows=0 loops=1,520)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
90. 21.280 21.280 ↑ 1.0 1 1,520

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

  • Index Cond: (guiaprestador.guiprotocolo = id)
91. 6.080 6.080 ↑ 1.0 1 1,520

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..8.45 rows=1 width=347) (actual time=0.004..0.004 rows=1 loops=1,520)

  • Index Cond: (produtosinterno.idguiaconvenio = id)
92. 3.038 3.038 ↑ 1.0 1 1,519

Index Scan using fibohospital_pkey on fibohospital hospitalprestador (cost=0.12..0.14 rows=1 width=51) (actual time=0.002..0.002 rows=1 loops=1,519)

  • Index Cond: (protocoloprestador.hospital = id)
93. 6.076 6.076 ↑ 1.0 1 1,519

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia guiarecurso (cost=0.43..0.66 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=1,519)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
94. 0.000 0.000 ↓ 0.0 0 1,519

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=1,519)

  • Index Cond: (id = guiarecurso.guiguiaassoc)
95. 30.380 30.380 ↑ 1.0 1 1,519

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=48) (actual time=0.019..0.020 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guibenefic = id)
96. 4.557 4.557 ↑ 1.0 1 1,519

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio (cost=0.28..0.29 rows=1 width=26) (actual time=0.002..0.003 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guicompetencia = id)
97. 0.000 0.000 ↓ 0.0 0 1,519

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=1,519)

  • Index Cond: (guiaconvenio.guimotglosa = id)
98. 4.557 4.557 ↑ 1.0 1 1,519

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

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
99. 3.038 3.038 ↑ 1.0 1 1,519

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioconciliacao (cost=0.14..0.15 rows=1 width=25) (actual time=0.002..0.002 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guistatusconciliacao = stcodigo)
100. 3.038 3.038 ↑ 1.0 1 1,519

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioanalise (cost=0.14..0.15 rows=1 width=25) (actual time=0.001..0.002 rows=1 loops=1,519)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
101. 10.633 10.633 ↑ 1.0 1 1,519

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

  • Index Cond: (guiaconvenio.guiprotocolo = id)
102. 3.038 3.038 ↑ 1.0 1 1,519

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

  • Index Cond: (protocoloconvenio.hospital = id)
103. 4.557 4.557 ↑ 1.0 1 1,519

Index Scan using fiboprestador_pkey on fiboprestador prestadororiginalconvenio (cost=0.28..0.30 rows=1 width=41) (actual time=0.002..0.003 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guiprestoriginal = id)
104. 3.038 3.038 ↑ 1.0 1 1,519

Index Scan using idx_view_smartdata_operadoras_operadora_id_idx on view_smartdata_operadoras operadoraoriginalconvenio (cost=0.14..0.16 rows=1 width=80) (actual time=0.001..0.002 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guioperadoraoriginal = operadora_id)
105. 4.557 4.557 ↑ 1.0 1 1,519

Index Scan using recebimento_pkey on recebimento (cost=0.28..0.30 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.recebimento_id = id)
106. 1.519 1.519 ↓ 0.0 0 1,519

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

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
107. 0.000 0.000 ↓ 0.0 0 1,519

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

  • Index Cond: (guiacobrancaoriginal.guiremessa = id)
108. 0.000 0.000 ↓ 0.0 0 1,519

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

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
109. 0.000 0.000 ↓ 0.0 0 1,519

Index Scan using idx_view_smartdata_operadoras_operadora_id_idx on view_smartdata_operadoras operadoraoriginalcobrancaoriginal (cost=0.14..0.16 rows=1 width=80) (actual time=0.000..0.000 rows=0 loops=1,519)

  • Index Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadora_id)
110. 9.114 9.114 ↓ 0.0 0 1,519

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

  • Index Cond: (guiaprestador.id_lote_recurso = id)
111. 24.304 24.304 ↑ 1.0 1 1,519

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.016..0.016 rows=1 loops=1,519)

  • 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
  • Rows Removed by Filter: 0
112. 1.519 1.519 ↓ 0.0 0 1,519

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

  • Index Cond: (guia_id = guiaprestador.id)
113.          

SubPlan (forNested Loop Left Join)

114. 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))
115. 0.250 0.250 ↑ 1.0 565 1

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

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
116. 3.038 3.038 ↓ 0.0 0 1,519

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

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
117. 1.519 1.519 ↓ 0.0 0 1,519

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.001..0.001 rows=0 loops=1,519)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
118. 4.557 10.633 ↑ 1.0 1 1,519

Aggregate (cost=17.33..17.34 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=1,519)

119. 1.255 6.076 ↓ 0.0 0 1,519

Nested Loop Left Join (cost=1.00..17.08 rows=1 width=90) (actual time=0.004..0.004 rows=0 loops=1,519)

120. 1.079 4.557 ↓ 0.0 0 1,519

Nested Loop Left Join (cost=0.71..16.76 rows=1 width=38) (actual time=0.003..0.003 rows=0 loops=1,519)

121. 3.038 3.038 ↓ 0.0 0 1,519

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

  • Index Cond: (id_guia = guiaconvenio.id)
122. 0.440 0.440 ↑ 1.0 1 88

Index Scan using fiboglosa_pkey on fiboglosa glosas (cost=0.43..8.45 rows=1 width=46) (actual time=0.005..0.005 rows=1 loops=88)

  • Index Cond: (id = glosasguia.elt)
123. 0.264 0.264 ↑ 1.0 1 88

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo (cost=0.29..0.31 rows=1 width=68) (actual time=0.003..0.003 rows=1 loops=88)

  • Index Cond: (id = glosas.glo_motivo)
124. 1.519 4.557 ↑ 1.0 1 1,519

Aggregate (cost=8.44..8.45 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=1,519)

125. 3.038 3.038 ↓ 0.0 0 1,519

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.002..0.002 rows=0 loops=1,519)

  • Index Cond: (guia_convenio_id = guiaconvenio.id)
126. 0.000 0.000 ↓ 0.0 0 1,519

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

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

Initplan (forIndex Scan)

128. 3.038 3.038 ↓ 0.0 0 1,519

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia fiboguia_2 (cost=0.43..8.45 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=1,519)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
129. 1.519 4.557 ↑ 1.0 1 1,519

Aggregate (cost=10.49..10.50 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=1,519)

130. 3.038 3.038 ↓ 0.0 0 1,519

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

  • Index Cond: (guicobrancaoriginal = guiaprestador.id)
  • Filter: (guisituacaoguia = 'PosAuditoria'::text)
  • Rows Removed by Filter: 0
131. 1.519 1.519 ↓ 0.0 0 1,519

Index Only Scan using idx_devolucao_guia_guia_devolvida_id_idx on devolucao_guia devolucao (cost=0.14..8.16 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=1,519)

  • Index Cond: (guia_devolvida_id = guiaprestador.id)
  • Heap Fetches: 0
132. 0.000 0.000 ↓ 0.0 0

Seq Scan on devolucao_guia devolucao_1 (cost=0.00..11.50 rows=150 width=8) (never executed)

Planning time : 34.491 ms
Execution time : 1,772.767 ms