explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jpnl

Settings
# exclusive inclusive rows x rows loops node
1. 0.049 3,773.198 ↓ 100.0 100 1

Limit (cost=118,634.50..118,634.50 rows=1 width=3,051) (actual time=3,773.130..3,773.198 rows=100 loops=1)

2. 4.744 3,773.149 ↓ 100.0 100 1

Sort (cost=118,634.50..118,634.50 rows=1 width=3,051) (actual time=3,773.129..3,773.149 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. 17.009 3,768.405 ↓ 1,386.0 1,386 1

WindowAgg (cost=118,485.11..118,634.48 rows=1 width=3,051) (actual time=3,762.663..3,768.405 rows=1,386 loops=1)

4. 30.013 3,751.396 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,485.11..118,634.39 rows=1 width=2,649) (actual time=3,464.255..3,751.396 rows=1,386 loops=1)

5.          

Initplan (forNested Loop Left Join)

6. 0.060 0.060 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 3.263 3,696.249 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,480.58..118,542.90 rows=1 width=1,875) (actual time=3,461.391..3,696.249 rows=1,386 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))
  • Rows Removed by Join Filter: 2
8. 1.911 3,658.336 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,480.29..118,542.56 rows=1 width=1,840) (actual time=3,460.070..3,658.336 rows=1,386 loops=1)

9. 1.486 3,648.109 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,480.00..118,542.24 rows=1 width=1,770) (actual time=3,459.150..3,648.109 rows=1,386 loops=1)

10. 1.764 3,646.623 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,479.86..118,542.07 rows=1 width=1,744) (actual time=3,459.147..3,646.623 rows=1,386 loops=1)

11. 1.595 3,644.859 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,479.43..118,541.60 rows=1 width=1,727) (actual time=3,459.145..3,644.859 rows=1,386 loops=1)

12. 0.977 3,643.264 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,479.14..118,541.28 rows=1 width=1,704) (actual time=3,459.143..3,643.264 rows=1,386 loops=1)

13. 1.184 3,638.129 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,478.72..118,540.61 rows=1 width=1,634) (actual time=3,459.141..3,638.129 rows=1,386 loops=1)

14. 0.872 3,632.787 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,478.44..118,540.30 rows=1 width=1,630) (actual time=3,458.793..3,632.787 rows=1,386 loops=1)

15. 1.369 3,629.143 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,478.30..118,540.13 rows=1 width=1,604) (actual time=3,458.787..3,629.143 rows=1,386 loops=1)

16. 1.914 3,625.002 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,478.02..118,539.83 rows=1 width=1,571) (actual time=3,458.781..3,625.002 rows=1,386 loops=1)

17. 1.564 3,621.702 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,477.89..118,539.67 rows=1 width=1,528) (actual time=3,458.774..3,621.702 rows=1,386 loops=1)

18. 2.107 3,610.436 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,477.47..118,539.20 rows=1 width=1,494) (actual time=3,458.002..3,610.436 rows=1,386 loops=1)

19. 1.143 3,606.943 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,477.34..118,539.04 rows=1 width=1,481) (actual time=3,457.998..3,606.943 rows=1,386 loops=1)

20. 0.887 3,603.028 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,477.20..118,538.87 rows=1 width=1,468) (actual time=3,457.994..3,603.028 rows=1,386 loops=1)

21. 1.368 3,597.983 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,477.06..118,538.71 rows=1 width=1,452) (actual time=3,457.985..3,597.983 rows=1,386 loops=1)

22. 1.970 3,596.615 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,476.79..118,538.41 rows=1 width=1,409) (actual time=3,457.983..3,596.615 rows=1,386 loops=1)

23. 0.847 3,591.873 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,476.51..118,538.10 rows=1 width=1,391) (actual time=3,457.976..3,591.873 rows=1,386 loops=1)

24. 1.806 3,559.148 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,476.09..118,537.63 rows=1 width=1,359) (actual time=3,457.967..3,559.148 rows=1,386 loops=1)

25. 2.481 3,555.956 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,475.66..118,536.96 rows=1 width=1,361) (actual time=3,457.963..3,555.956 rows=1,386 loops=1)

26. 2.031 3,517.439 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,475.24..118,536.29 rows=1 width=1,337) (actual time=3,457.765..3,517.439 rows=1,386 loops=1)

27. 3.565 3,514.022 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,475.11..118,536.13 rows=1 width=1,294) (actual time=3,457.747..3,514.022 rows=1,386 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
28. 0.659 3,506.299 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=118,474.68..118,510.75 rows=3 width=955) (actual time=3,457.729..3,506.299 rows=1,386 loops=1)

29. 0.860 3,477.920 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=118,474.26..118,509.33 rows=3 width=955) (actual time=3,457.073..3,477.920 rows=1,386 loops=1)

30. 0.751 3,472.902 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=118,473.84..118,507.97 rows=3 width=933) (actual time=3,457.071..3,472.902 rows=1,386 loops=1)

31. 1.149 3,469.379 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=118,473.70..118,507.46 rows=3 width=907) (actual time=3,457.064..3,469.379 rows=1,386 loops=1)

32. 1.835 3,468.230 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=118,473.42..118,506.54 rows=3 width=874) (actual time=3,457.061..3,468.230 rows=1,386 loops=1)

33. 1.757 3,465.009 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=118,473.29..118,506.06 rows=3 width=861) (actual time=3,457.056..3,465.009 rows=1,386 loops=1)

34. 2.622 3,460.480 ↓ 462.0 1,386 1

Merge Left Join (cost=118,473.15..118,505.57 rows=3 width=848) (actual time=3,457.039..3,460.480 rows=1,386 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
35. 6.256 3,441.792 ↓ 462.0 1,386 1

Sort (cost=117,623.25..117,623.25 rows=3 width=837) (actual time=3,441.148..3,441.792 rows=1,386 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 1449kB
36. 0.711 3,435.536 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,544.71..117,623.22 rows=3 width=837) (actual time=2,869.396..3,435.536 rows=1,386 loops=1)

37. 1.639 3,432.053 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,544.57..117,622.73 rows=3 width=821) (actual time=2,869.391..3,432.053 rows=1,386 loops=1)

38. 1.148 3,427.642 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,544.43..117,622.23 rows=3 width=805) (actual time=2,869.381..3,427.642 rows=1,386 loops=1)

39. 0.807 3,426.494 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,544.16..117,621.33 rows=3 width=762) (actual time=2,869.378..3,426.494 rows=1,386 loops=1)

40. 1.619 3,422.915 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,543.88..117,620.42 rows=3 width=744) (actual time=2,869.369..3,422.915 rows=1,386 loops=1)

41. 1.740 3,411.594 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,543.59..117,619.45 rows=3 width=694) (actual time=2,868.701..3,411.594 rows=1,386 loops=1)

42. 1.670 3,278.184 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,543.17..117,618.03 rows=3 width=641) (actual time=2,867.610..3,278.184 rows=1,386 loops=1)

43. 13.910 3,265.426 ↓ 462.0 1,386 1

GroupAggregate (cost=117,542.74..117,592.64 rows=3 width=217) (actual time=2,867.037..3,265.426 rows=1,386 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
44. 7.894 2,866.016 ↓ 2,570.0 7,710 1

Sort (cost=117,542.74..117,542.75 rows=3 width=110) (actual time=2,864.653..2,866.016 rows=7,710 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 1277kB
45. 3.009 2,858.122 ↓ 2,570.0 7,710 1

Subquery Scan on produtosinterno (cost=262.22..117,542.72 rows=3 width=110) (actual time=38.837..2,858.122 rows=7,710 loops=1)

46. 44.595 2,855.113 ↓ 2,570.0 7,710 1

Nested Loop Left Join (cost=262.22..117,542.69 rows=3 width=1,193) (actual time=38.837..2,855.113 rows=7,710 loops=1)

47. 8.001 2,371.048 ↓ 2,570.0 7,710 1

Nested Loop Left Join (cost=261.93..117,486.68 rows=3 width=174) (actual time=35.458..2,371.048 rows=7,710 loops=1)

48. 2.252 2,231.977 ↓ 2,570.0 7,710 1

Nested Loop (cost=261.50..117,480.24 rows=3 width=160) (actual time=34.583..2,231.977 rows=7,710 loops=1)

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

  • Index Cond: (id = '306577412'::bigint)
  • Filter: (comp_convenio = 'SulAmerica'::text)
50. 7.318 2,229.697 ↓ 2,570.0 7,710 1

Nested Loop (cost=261.23..117,471.91 rows=3 width=168) (actual time=34.553..2,229.697 rows=7,710 loops=1)

51. 0.000 2,068.179 ↓ 13.1 7,710 1

Nested Loop (cost=260.80..116,198.89 rows=588 width=152) (actual time=34.185..2,068.179 rows=7,710 loops=1)

52. 50.482 1,288.323 ↓ 36.9 65,064 1

Nested Loop (cost=260.36..111,927.63 rows=1,764 width=98) (actual time=33.250..1,288.323 rows=65,064 loops=1)

53. 1.437 297.173 ↓ 54.1 5,469 1

Nested Loop (cost=259.92..7,356.87 rows=101 width=25) (actual time=32.340..297.173 rows=5,469 loops=1)

54. 0.051 0.071 ↑ 1.0 23 1

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

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

  • Index Cond: (comp_convenio = 'SulAmerica'::text)
56. 227.516 295.665 ↓ 47.6 238 23

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=255.47..319.04 rows=5 width=33) (actual time=7.839..12.855 rows=238 loops=23)

  • Recheck Cond: ((guicompetencia = competenciaprestador_1.id) AND (guicompetenciaassoc = '306577412'::bigint))
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 265
  • Heap Blocks: exact=1608
57. 2.967 68.149 ↓ 0.0 0 23

BitmapAnd (cost=255.47..255.47 rows=16 width=0) (actual time=2.963..2.963 rows=0 loops=23)

58. 41.124 41.124 ↓ 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.788..1.788 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
59. 24.058 24.058 ↑ 1.0 11,553 23

Bitmap Index Scan on idx_fiboguia_guicompetenciaassoc_idx (cost=0.00..220.92 rows=11,799 width=0) (actual time=1.046..1.046 rows=11,553 loops=23)

  • Index Cond: (guicompetenciaassoc = '306577412'::bigint)
60. 940.668 940.668 ↑ 56.2 12 5,469

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoprestador (cost=0.44..1,028.60 rows=675 width=81) (actual time=0.066..0.172 rows=12 loops=5,469)

  • Index Cond: (prodguia = guiaprestador_1.id)
61. 780.768 780.768 ↓ 0.0 0 65,064

Index Scan using fiboproduto_pkey on fiboproduto produtoconvenio (cost=0.44..2.41 rows=1 width=62) (actual time=0.012..0.012 rows=0 loops=65,064)

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

Index Scan using fiboguia_pkey on fiboguia guiaconvenio_1 (cost=0.43..2.15 rows=1 width=24) (actual time=0.020..0.020 rows=1 loops=7,710)

  • Index Cond: (id = produtoconvenio.prodguia)
  • Filter: ((guicompetencia = '306577412'::bigint) AND (guiorigem = 'CONVENIO'::text))
63. 131.070 131.070 ↑ 1.0 1 7,710

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recursoproduto (cost=0.42..2.14 rows=1 width=30) (actual time=0.017..0.017 rows=1 loops=7,710)

  • Index Cond: (produtoprestador.id = rec_produto)
64. 7.710 7.710 ↓ 0.0 0 7,710

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=7,710)

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

SubPlan (forNested Loop Left Join)

66. 215.880 431.760 ↑ 1.0 1 7,710

Aggregate (cost=17.48..17.49 rows=1 width=32) (actual time=0.056..0.056 rows=1 loops=7,710)

67. 7.563 215.880 ↑ 1.0 1 7,710

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=98) (actual time=0.027..0.028 rows=1 loops=7,710)

68. 6.877 185.040 ↑ 1.0 1 7,710

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=38) (actual time=0.023..0.024 rows=1 loops=7,710)

69. 46.260 46.260 ↑ 1.0 1 7,710

Index Scan using idx_fiboglosasproduto_id_produto_idx on fiboglosasproduto glosasproduto (cost=0.43..8.45 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=7,710)

  • Index Cond: (id_produto = produtoconvenio.id)
70. 131.903 131.903 ↑ 1.0 1 7,759

Index Scan using fiboglosa_pkey on fiboglosa glosas_1 (cost=0.43..8.45 rows=1 width=46) (actual time=0.017..0.017 rows=1 loops=7,759)

  • Index Cond: (id = glosasproduto.elt)
71. 23.277 23.277 ↑ 1.0 1 7,759

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo_1 (cost=0.29..0.31 rows=1 width=68) (actual time=0.003..0.003 rows=1 loops=7,759)

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

SubPlan (forGroupAggregate)

73. 7.710 385.500 ↑ 1.0 1 7,710

Result (cost=16.55..16.56 rows=1 width=1) (actual time=0.050..0.050 rows=1 loops=7,710)

74.          

Initplan (forResult)

75. 377.790 377.790 ↓ 0.0 0 7,710

Seq Scan on anexo_recurso anexo_recurso_2 (cost=0.00..16.55 rows=1 width=0) (actual time=0.049..0.049 rows=0 loops=7,710)

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

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

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

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

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

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

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

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

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

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,386)

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

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,386)

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

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

  • Index Cond: (guiaprestador.guisituacaoguiaassoc = sitcodigo)
83. 10.373 16.066 ↑ 5.1 847 1

Sort (cost=849.90..860.70 rows=4,318 width=26) (actual time=15.878..16.066 rows=847 loops=1)

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

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

85. 2.772 2.772 ↑ 1.0 1 1,386

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,386)

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

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,386)

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

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,386)

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

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

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

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.003 rows=0 loops=1,386)

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

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

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

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

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

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,386)

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

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

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

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

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

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=48) (actual time=0.022..0.023 rows=1 loops=1,386)

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

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,386)

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

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,386)

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

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

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

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,386)

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

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,386)

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

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,386)

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

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,386)

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

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,386)

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

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

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

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

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

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

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

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,386)

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

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,386)

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

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,386)

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

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,386)

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

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.025..0.025 rows=1 loops=1,386)

  • 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.386 1.386 ↓ 0.0 0 1,386

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,386)

  • 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.126 0.126 ↑ 1.0 565 1

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

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

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,386)

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

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,386)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
118. 4.158 8.316 ↑ 1.0 1 1,386

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

119. 0.000 4.158 ↓ 0.0 0 1,386

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

120. 1.086 4.158 ↓ 0.0 0 1,386

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

121. 2.772 2.772 ↓ 0.0 0 1,386

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,386)

  • Index Cond: (id_guia = guiaconvenio.id)
122. 0.300 0.300 ↑ 1.0 1 75

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

  • Index Cond: (id = glosasguia.elt)
123. 0.225 0.225 ↑ 1.0 1 75

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=75)

  • Index Cond: (id = glosas.glo_motivo)
124. 1.386 4.158 ↑ 1.0 1 1,386

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

125. 2.772 2.772 ↓ 0.0 0 1,386

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,386)

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

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,386)

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

Initplan (forIndex Scan)

128. 2.772 2.772 ↓ 0.0 0 1,386

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,386)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
129. 1.386 5.544 ↑ 1.0 1 1,386

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

130. 4.158 4.158 ↓ 0.0 0 1,386

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

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

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,386)

  • 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 : 101.997 ms
Execution time : 3,843.676 ms