explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5tW7

Settings
# exclusive inclusive rows x rows loops node
1. 0.048 983.811 ↓ 100.0 100 1

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

2. 4.402 983.763 ↓ 100.0 100 1

Sort (cost=121,388.10..121,388.10 rows=1 width=3,051) (actual time=983.755..983.763 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. 14.841 979.361 ↓ 1,519.0 1,519 1

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

4. 23.319 964.520 ↓ 1,519.0 1,519 1

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

5.          

Initplan (for Nested Loop Left Join)

6. 0.021 0.021 ↑ 1.0 1 1

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

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

Nested Loop Left Join (cost=121,234.18..121,296.50 rows=1 width=1,875) (actual time=823.294..919.819 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.901 908.994 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,233.89..121,296.16 rows=1 width=1,840) (actual time=823.276..908.994 rows=1,519 loops=1)

9. 1.313 907.093 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,233.60..121,295.84 rows=1 width=1,770) (actual time=823.269..907.093 rows=1,519 loops=1)

10. 1.282 905.780 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,233.46..121,295.67 rows=1 width=1,744) (actual time=823.266..905.780 rows=1,519 loops=1)

11. 1.368 904.498 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,233.03..121,295.20 rows=1 width=1,727) (actual time=823.264..904.498 rows=1,519 loops=1)

12. 1.319 903.130 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,232.74..121,294.88 rows=1 width=1,704) (actual time=823.262..903.130 rows=1,519 loops=1)

13. 1.218 901.811 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,232.32..121,294.21 rows=1 width=1,634) (actual time=823.259..901.811 rows=1,519 loops=1)

14. 1.510 897.555 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,232.04..121,293.90 rows=1 width=1,630) (actual time=823.248..897.555 rows=1,519 loops=1)

15. 1.046 894.526 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,231.90..121,293.73 rows=1 width=1,604) (actual time=823.244..894.526 rows=1,519 loops=1)

16. 1.262 890.442 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,231.62..121,293.43 rows=1 width=1,571) (actual time=823.237..890.442 rows=1,519 loops=1)

17. 1.692 887.661 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,231.49..121,293.27 rows=1 width=1,528) (actual time=823.219..887.661 rows=1,519 loops=1)

18. 1.667 882.931 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,231.07..121,292.80 rows=1 width=1,494) (actual time=823.211..882.931 rows=1,519 loops=1)

19. 2.081 879.745 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.94..121,292.64 rows=1 width=1,481) (actual time=823.207..879.745 rows=1,519 loops=1)

20. 1.628 876.145 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.80..121,292.47 rows=1 width=1,468) (actual time=823.203..876.145 rows=1,519 loops=1)

21. 1.258 871.479 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.66..121,292.31 rows=1 width=1,452) (actual time=823.197..871.479 rows=1,519 loops=1)

22. 1.155 870.221 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.39..121,292.01 rows=1 width=1,409) (actual time=823.194..870.221 rows=1,519 loops=1)

23. 0.754 866.028 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,230.11..121,291.70 rows=1 width=1,391) (actual time=823.189..866.028 rows=1,519 loops=1)

24. 1.263 860.717 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,229.69..121,291.23 rows=1 width=1,359) (actual time=823.182..860.717 rows=1,519 loops=1)

25. 1.918 859.454 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,229.26..121,290.56 rows=1 width=1,361) (actual time=823.180..859.454 rows=1,519 loops=1)

26. 1.503 854.498 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,228.84..121,289.89 rows=1 width=1,337) (actual time=823.172..854.498 rows=1,519 loops=1)

27. 2.126 851.476 ↓ 1,519.0 1,519 1

Nested Loop Left Join (cost=121,228.71..121,289.73 rows=1 width=1,294) (actual time=823.160..851.476 rows=1,519 loops=1)

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

Nested Loop Left Join (cost=121,228.28..121,264.35 rows=3 width=955) (actual time=823.149..844.790 rows=1,520 loops=1)

29. 0.940 840.123 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=121,227.86..121,262.93 rows=3 width=955) (actual time=823.139..840.123 rows=1,520 loops=1)

30. 1.721 837.663 ↓ 506.7 1,520 1

Nested Loop Left Join (cost=121,227.44..121,261.57 rows=3 width=933) (actual time=823.138..837.663 rows=1,520 loops=1)

31. 1.087 834.422 ↓ 506.7 1,520 1

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

32. 1.528 833.335 ↓ 506.7 1,520 1

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

33. 1.267 830.287 ↓ 506.7 1,520 1

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

34. 2.216 825.980 ↓ 506.7 1,520 1

Merge Left Join (cost=121,226.75..121,259.17 rows=3 width=848) (actual time=823.115..825.980 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. 5.543 812.072 ↓ 506.7 1,520 1

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

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

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

37. 0.759 803.433 ↓ 506.7 1,520 1

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

38. 0.981 799.634 ↓ 506.7 1,520 1

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

39. 1.408 798.653 ↓ 506.7 1,520 1

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

40. 0.355 795.725 ↓ 506.7 1,520 1

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

41. 0.516 792.330 ↓ 506.7 1,520 1

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

42. 2.230 787.254 ↓ 506.7 1,520 1

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

43. 9.406 781.984 ↓ 506.7 1,520 1

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

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

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

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

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

46. 25.083 481.450 ↓ 2,254.3 6,763 1

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

47. 6.407 253.477 ↓ 2,254.3 6,763 1

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

48. 1.584 233.544 ↓ 2,254.3 6,763 1

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

49. 0.009 0.009 ↑ 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.008..0.009 rows=1 loops=1)

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

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

51. 27.009 209.239 ↓ 11.1 6,763 1

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

52. 26.666 94.258 ↓ 24.0 43,986 1

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

53. 0.864 42.312 ↓ 60.2 6,320 1

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

54. 0.031 0.048 ↑ 1.0 23 1

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

  • Recheck Cond: (comp_convenio = 'SulAmerica'::text)
  • Heap Blocks: exact=8
55. 0.017 0.017 ↑ 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.017..0.017 rows=23 loops=1)

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

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=263.00..330.52 rows=5 width=33) (actual time=1.617..1.800 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. 2.369 34.776 ↓ 0.0 0 23

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

58. 14.904 14.904 ↓ 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=0.648..0.648 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
59. 17.503 17.503 ↓ 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=0.761..0.761 rows=12,278 loops=23)

  • Index Cond: (guicompetenciaassoc = '329678849'::bigint)
60. 25.280 25.280 ↑ 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.003..0.004 rows=7 loops=6,320)

  • Index Cond: (prodguia = guiaprestador_1.id)
61. 87.972 87.972 ↓ 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.002..0.002 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. 20.289 20.289 ↑ 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.002..0.003 rows=1 loops=6,763)

  • Index Cond: (id = produtoconvenio.prodguia)
  • Filter: ((guicompetencia = '329678849'::bigint) AND (guiorigem = 'CONVENIO'::text))
63. 13.526 13.526 ↑ 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.002..0.002 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.000..0.001 rows=0 loops=6,763)

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

SubPlan (for Nested Loop Left Join)

66. 142.023 196.127 ↑ 1.0 1 6,763

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

67. 0.000 54.104 ↑ 1.0 1 6,763

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

68. 6.715 40.578 ↑ 1.0 1 6,763

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=38) (actual time=0.005..0.006 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.002..0.003 rows=1 loops=6,763)

  • Index Cond: (id_produto = produtoconvenio.id)
70. 13.574 13.574 ↑ 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.002..0.002 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 (for GroupAggregate)

73. 6.763 284.046 ↑ 1.0 1 6,763

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

74.          

Initplan (for Result)

75. 277.283 277.283 ↓ 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.041..0.041 rows=0 loops=6,763)

  • Filter: ((entidade_id = produtosinterno.idprodutoprestador) AND (nivel = 'Produto'::text))
  • Rows Removed by Filter: 570
76. 3.040 3.040 ↑ 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.002..0.002 rows=1 loops=1,520)

  • Index Cond: (produtosinterno.idguiaprestador = id)
77. 4.560 4.560 ↑ 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.002..0.003 rows=1 loops=1,520)

  • Index Cond: (guiaprestador.guibenefic = id)
78. 3.040 3.040 ↑ 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.001..0.002 rows=1 loops=1,520)

  • Index Cond: (guiaprestador.guiremessa = id)
79. 1.520 1.520 ↑ 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.001 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. 1.520 1.520 ↑ 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.001 rows=1 loops=1,520)

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

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

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

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

85. 3.040 3.040 ↑ 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.002..0.002 rows=1 loops=1,520)

  • Index Cond: (guiaprestador.guistatusconciliacao = stcodigo)
86. 1.520 1.520 ↑ 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.001 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. 1.520 1.520 ↑ 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=34) (actual time=0.001..0.001 rows=1 loops=1,520)

  • Index Cond: (guiaprestador.guioperadoraoriginal = operadora_id)
89. 1.520 1.520 ↓ 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.001..0.001 rows=0 loops=1,520)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
90. 3.040 3.040 ↑ 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.002..0.002 rows=1 loops=1,520)

  • Index Cond: (guiaprestador.guiprotocolo = id)
91. 4.560 4.560 ↑ 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.002..0.003 rows=1 loops=1,520)

  • Index Cond: (produtosinterno.idguiaconvenio = id)
92. 1.519 1.519 ↑ 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.001..0.001 rows=1 loops=1,519)

  • Index Cond: (protocoloprestador.hospital = id)
93. 3.038 3.038 ↑ 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.002..0.002 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. 4.557 4.557 ↑ 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.002..0.003 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guibenefic = id)
96. 3.038 3.038 ↑ 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.002 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. 3.038 3.038 ↑ 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.002..0.002 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
99. 1.519 1.519 ↑ 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.001..0.001 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guistatusconciliacao = stcodigo)
100. 1.519 1.519 ↑ 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.001 rows=1 loops=1,519)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
101. 3.038 3.038 ↑ 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.002..0.002 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
102. 1.519 1.519 ↑ 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.001 rows=1 loops=1,519)

  • Index Cond: (protocoloconvenio.hospital = id)
103. 3.038 3.038 ↑ 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.002 rows=1 loops=1,519)

  • Index Cond: (guiaconvenio.guiprestoriginal = id)
104. 1.519 1.519 ↑ 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=34) (actual time=0.001..0.001 rows=1 loops=1,519)

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

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

  • Index Cond: (guiaconvenio.recebimento_id = id)
106. 0.000 0.000 ↓ 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.000..0.000 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=34) (actual time=0.000..0.000 rows=0 loops=1,519)

  • Index Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadora_id)
110. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=1,519)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
111. 9.114 9.114 ↑ 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.005..0.006 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 (for Nested 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.095 0.095 ↑ 1.0 565 1

Seq Scan on anexo_recurso anexo_recurso_1 (cost=0.00..15.12 rows=565 width=8) (actual time=0.005..0.095 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 7.595 ↑ 1.0 1 1,519

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

119. 0.000 3.038 ↓ 0.0 0 1,519

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

120. 1.255 3.038 ↓ 0.0 0 1,519

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

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

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

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

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

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

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

Aggregate (cost=8.44..8.45 rows=1 width=32) (actual time=0.002..0.002 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 (for Index Scan)

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

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

Aggregate (cost=10.49..10.50 rows=1 width=32) (actual time=0.002..0.002 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 : 39.199 ms
Execution time : 986.636 ms