explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RZ3D

Settings
# exclusive inclusive rows x rows loops node
1. 0.055 12,001.177 ↓ 5.9 100 1

Limit (cost=120,532.45..120,532.49 rows=17 width=3,051) (actual time=12,001.107..12,001.177 rows=100 loops=1)

2. 4.855 12,001.122 ↓ 5.9 100 1

Sort (cost=120,532.45..120,532.49 rows=17 width=3,051) (actual time=12,001.105..12,001.122 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. 15.873 11,996.267 ↓ 81.5 1,386 1

WindowAgg (cost=119,013.64..120,531.93 rows=17 width=3,051) (actual time=11,990.761..11,996.267 rows=1,386 loops=1)

4. 33.042 11,980.394 ↓ 81.5 1,386 1

Hash Right Join (cost=119,013.64..120,530.53 rows=17 width=2,649) (actual time=11,926.404..11,980.394 rows=1,386 loops=1)

  • Hash Cond: (operadora_multitenant_cobrancaoriginal.id = operadoraoriginalcobrancaoriginal.id_multitenant)
5.          

Initplan (forHash Right Join)

6. 0.041 0.041 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 7.518 7.518 ↑ 8.1 105 1

Foreign Scan on operadora_multitenant operadora_multitenant_cobrancaoriginal (cost=100.00..135.59 rows=853 width=72) (actual time=5.393..7.518 rows=105 loops=1)

8. 23.150 11,920.094 ↓ 346.5 1,386 1

Hash (cost=118,909.21..118,909.21 rows=4 width=1,997) (actual time=11,920.094..11,920.094 rows=1,386 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1720kB
9. 4.915 11,896.944 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=118,723.95..118,909.21 rows=4 width=1,997) (actual time=1,141.244..11,896.944 rows=1,386 loops=1)

10. 8.392 11,889.257 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=118,723.80..118,908.51 rows=4 width=1,957) (actual time=1,141.238..11,889.257 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
11. 4.413 11,840.671 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=118,723.51..118,907.17 rows=4 width=1,922) (actual time=1,141.203..11,840.671 rows=1,386 loops=1)

12. 6.292 11,834.872 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=118,723.22..118,905.89 rows=4 width=1,852) (actual time=1,141.179..11,834.872 rows=1,386 loops=1)

13. 3,117.370 11,825.808 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=118,723.08..118,905.21 rows=4 width=1,836) (actual time=1,141.175..11,825.808 rows=1,386 loops=1)

14. 4.014 1,375.112 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,622.91..118,766.17 rows=1 width=1,764) (actual time=1,136.010..1,375.112 rows=1,386 loops=1)

15. 4.329 1,371.098 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,622.48..118,765.70 rows=1 width=1,747) (actual time=1,136.007..1,371.098 rows=1,386 loops=1)

16. 3.715 1,366.769 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,622.19..118,765.38 rows=1 width=1,724) (actual time=1,136.003..1,366.769 rows=1,386 loops=1)

17. 4.105 1,363.054 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,621.77..118,764.70 rows=1 width=1,654) (actual time=1,135.999..1,363.054 rows=1,386 loops=1)

18. 3.358 1,347.861 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,621.49..118,764.40 rows=1 width=1,650) (actual time=1,135.980..1,347.861 rows=1,386 loops=1)

19. 3.251 1,336.187 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,621.21..118,764.09 rows=1 width=1,617) (actual time=1,135.969..1,336.187 rows=1,386 loops=1)

20. 4.193 1,327.392 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,621.09..118,763.94 rows=1 width=1,574) (actual time=1,135.963..1,327.392 rows=1,386 loops=1)

21. 4.542 1,312.111 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,620.66..118,763.47 rows=1 width=1,540) (actual time=1,135.937..1,312.111 rows=1,386 loops=1)

22. 4.358 1,302.025 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,620.53..118,763.30 rows=1 width=1,527) (actual time=1,135.928..1,302.025 rows=1,386 loops=1)

23. 3.739 1,290.737 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,620.39..118,763.14 rows=1 width=1,514) (actual time=1,135.920..1,290.737 rows=1,386 loops=1)

24. 3.666 1,274.524 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,620.26..118,762.98 rows=1 width=1,498) (actual time=1,135.905..1,274.524 rows=1,386 loops=1)

25. 3.279 1,270.858 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,619.98..118,762.67 rows=1 width=1,455) (actual time=1,135.901..1,270.858 rows=1,386 loops=1)

26. 3.580 1,259.263 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,619.71..118,762.37 rows=1 width=1,437) (actual time=1,135.892..1,259.263 rows=1,386 loops=1)

27. 3.454 1,241.823 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,619.28..118,761.90 rows=1 width=1,405) (actual time=1,135.879..1,241.823 rows=1,386 loops=1)

28. 5.798 1,235.597 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,618.86..118,761.22 rows=1 width=1,407) (actual time=1,135.875..1,235.597 rows=1,386 loops=1)

29. 3.937 1,218.711 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,618.43..118,760.55 rows=1 width=1,383) (actual time=1,135.861..1,218.711 rows=1,386 loops=1)

30. 3.669 1,209.230 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,618.30..118,760.40 rows=1 width=1,340) (actual time=1,135.812..1,209.230 rows=1,386 loops=1)

31. 13.965 1,187.543 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=118,617.88..118,759.93 rows=1 width=1,340) (actual time=1,135.288..1,187.543 rows=1,386 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
32. 11.583 1,151.402 ↓ 106.6 1,386 1

Merge Left Join (cost=118,617.45..118,649.95 rows=13 width=1,001) (actual time=1,135.267..1,151.402 rows=1,386 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
33. 8.023 1,126.648 ↓ 106.6 1,386 1

Sort (cost=117,767.55..117,767.58 rows=13 width=990) (actual time=1,122.962..1,126.648 rows=1,386 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 1456kB
34. 1.221 1,118.625 ↓ 106.6 1,386 1

Merge Left Join (cost=117,767.14..117,767.31 rows=13 width=990) (actual time=1,117.099..1,118.625 rows=1,386 loops=1)

  • Merge Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
35. 4.607 1,117.244 ↓ 106.6 1,386 1

Sort (cost=117,765.69..117,765.73 rows=13 width=977) (actual time=1,117.063..1,117.244 rows=1,386 loops=1)

  • Sort Key: guiaprestador.guistatusanaliseglosa
  • Sort Method: quicksort Memory: 1456kB
36. 2.711 1,112.637 ↓ 106.6 1,386 1

Hash Right Join (cost=117,726.54..117,765.45 rows=13 width=977) (actual time=1,107.941..1,112.637 rows=1,386 loops=1)

  • Hash Cond: (operadora_multitenant_prestador.id = operadoraoriginalprestador.id_multitenant)
37. 62.398 62.398 ↑ 8.1 105 1

Foreign Scan on operadora_multitenant operadora_multitenant_prestador (cost=100.00..135.59 rows=853 width=72) (actual time=60.361..62.398 rows=105 loops=1)

38. 1.832 1,047.528 ↓ 462.0 1,386 1

Hash (cost=117,626.50..117,626.50 rows=3 width=921) (actual time=1,047.528..1,047.528 rows=1,386 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 913kB
39. 0.518 1,045.696 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,545.68..117,626.50 rows=3 width=921) (actual time=644.908..1,045.696 rows=1,386 loops=1)

40. 1.171 1,007.756 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,545.26..117,625.14 rows=3 width=899) (actual time=644.906..1,007.756 rows=1,386 loops=1)

41. 0.944 1,005.199 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,545.12..117,624.63 rows=3 width=883) (actual time=644.900..1,005.199 rows=1,386 loops=1)

42. 1.661 1,004.255 ↓ 462.0 1,386 1

Nested Loop Left Join (cost=117,544.84..117,623.71 rows=3 width=850) (actual time=644.898..1,004.255 rows=1,386 loops=1)

43. 1.458 1,001.208 ↓ 462.0 1,386 1

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

44. 0.775 998.364 ↓ 462.0 1,386 1

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

45. 0.879 994.817 ↓ 462.0 1,386 1

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

46. 1.526 993.938 ↓ 462.0 1,386 1

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

47. 0.975 991.026 ↓ 462.0 1,386 1

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

48. 0.621 987.279 ↓ 462.0 1,386 1

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

49. 2.124 982.500 ↓ 462.0 1,386 1

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

50. 9.567 977.604 ↓ 462.0 1,386 1

GroupAggregate (cost=117,542.74..117,592.64 rows=3 width=217) (actual time=644.598..977.604 rows=1,386 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
51. 4.950 644.217 ↓ 2,570.0 7,710 1

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

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 1277kB
52. 2.074 639.267 ↓ 2,570.0 7,710 1

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

53. 33.983 637.193 ↓ 2,570.0 7,710 1

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

54. 8.681 371.910 ↓ 2,570.0 7,710 1

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

55. 1.731 347.809 ↓ 2,570.0 7,710 1

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

56. 0.010 0.010 ↑ 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.009..0.010 rows=1 loops=1)

  • Index Cond: (id = '306577412'::bigint)
  • Filter: (comp_convenio = 'SulAmerica'::text)
57. 2.209 346.068 ↓ 2,570.0 7,710 1

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

58. 0.000 320.729 ↓ 13.1 7,710 1

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

59. 31.227 134.402 ↓ 36.9 65,064 1

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

60. 0.766 43.016 ↓ 54.1 5,469 1

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

61. 0.047 0.068 ↑ 1.0 23 1

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

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

  • Index Cond: (comp_convenio = 'SulAmerica'::text)
63. 6.555 42.182 ↓ 47.6 238 23

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=255.47..319.04 rows=5 width=33) (actual time=1.653..1.834 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
64. 2.392 35.627 ↓ 0.0 0 23

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

65. 14.513 14.513 ↓ 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.631..0.631 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
66. 18.722 18.722 ↑ 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=0.814..0.814 rows=11,553 loops=23)

  • Index Cond: (guicompetenciaassoc = '306577412'::bigint)
67. 60.159 60.159 ↑ 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.005..0.011 rows=12 loops=5,469)

  • Index Cond: (prodguia = guiaprestador_1.id)
68. 195.192 195.192 ↓ 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.003..0.003 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
69. 23.130 23.130 ↑ 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.002..0.003 rows=1 loops=7,710)

  • Index Cond: (id = produtoconvenio.prodguia)
  • Filter: ((guicompetencia = '306577412'::bigint) AND (guiorigem = 'CONVENIO'::text))
70. 15.420 15.420 ↑ 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.002..0.002 rows=1 loops=7,710)

  • Index Cond: (produtoprestador.id = rec_produto)
71. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=7,710)

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

SubPlan (forNested Loop Left Join)

73. 154.200 231.300 ↑ 1.0 1 7,710

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

74. 0.000 77.100 ↑ 1.0 1 7,710

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

75. 7.563 61.680 ↑ 1.0 1 7,710

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

76. 30.840 30.840 ↑ 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.004..0.004 rows=1 loops=7,710)

  • Index Cond: (id_produto = produtoconvenio.id)
77. 23.277 23.277 ↑ 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.002..0.003 rows=1 loops=7,759)

  • Index Cond: (id = glosasproduto.elt)
78. 15.518 15.518 ↑ 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.002..0.002 rows=1 loops=7,759)

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

SubPlan (forGroupAggregate)

80. 7.710 323.820 ↑ 1.0 1 7,710

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

81.          

Initplan (forResult)

82. 316.110 316.110 ↓ 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.041..0.041 rows=0 loops=7,710)

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

  • Index Cond: (produtosinterno.idguiaprestador = id)
84. 4.158 4.158 ↑ 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.003..0.003 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guibenefic = id)
85. 2.772 2.772 ↑ 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.002..0.002 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guiremessa = id)
86. 1.386 1.386 ↑ 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.001..0.001 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guicompetencia = id)
87. 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)
88. 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)
89. 1.386 1.386 ↑ 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.001..0.001 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guisituacaoguiaassoc = sitcodigo)
90. 1.386 1.386 ↑ 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.001..0.001 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guistatusconciliacao = stcodigo)
91. 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)
92. 1.386 1.386 ↑ 1.0 1 1,386

Index Scan using fibooperadora_pkey on fibooperadora operadoraoriginalprestador (cost=0.14..0.16 rows=1 width=24) (actual time=0.001..0.001 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guioperadoraoriginal = id)
93. 37.422 37.422 ↓ 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.027..0.027 rows=0 loops=1,386)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
94. 0.149 0.160 ↓ 93.1 1,397 1

Sort (cost=1.44..1.48 rows=15 width=25) (actual time=0.031..0.160 rows=1,397 loops=1)

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

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

96. 11.264 13.171 ↑ 5.1 847 1

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

  • Sort Key: detalhes_quitacao_rpa.numero_remessa, detalhes_quitacao_rpa.nome_convenio
  • Sort Method: quicksort Memory: 500kB
97. 1.907 1.907 ↑ 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..1.907 rows=4,318 loops=1)

98. 22.176 22.176 ↑ 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.015..0.016 rows=1 loops=1,386)

  • Index Cond: (produtosinterno.idguiaconvenio = id)
99. 18.018 18.018 ↑ 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.012..0.013 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guiprotocolo = id)
100. 5.544 5.544 ↑ 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.004..0.004 rows=1 loops=1,386)

  • Index Cond: (protocoloprestador.hospital = id)
101. 11.088 11.088 ↑ 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.008..0.008 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
102. 2.772 2.772 ↓ 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.002..0.002 rows=0 loops=1,386)

  • Index Cond: (id = guiarecurso.guiguiaassoc)
103. 13.860 13.860 ↑ 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.009..0.010 rows=1 loops=1,386)

  • Index Cond: (guiaconvenio.guibenefic = id)
104. 8.316 8.316 ↑ 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.005..0.006 rows=1 loops=1,386)

  • Index Cond: (guiaconvenio.guicompetencia = id)
105. 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)
106. 12.474 12.474 ↑ 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.008..0.009 rows=1 loops=1,386)

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
107. 6.930 6.930 ↑ 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.005..0.005 rows=1 loops=1,386)

  • Index Cond: (guiaconvenio.guistatusconciliacao = stcodigo)
108. 5.544 5.544 ↑ 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.004..0.004 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
109. 11.088 11.088 ↑ 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.008 rows=1 loops=1,386)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
110. 5.544 5.544 ↑ 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.003..0.004 rows=1 loops=1,386)

  • Index Cond: (protocoloconvenio.hospital = id)
111. 8.316 8.316 ↑ 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.005..0.006 rows=1 loops=1,386)

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

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

  • Index Cond: (guiaconvenio.recebimento_id = id)
113. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=1,386)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
114. 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)
115. 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)
116. 69.300 7,333.326 ↑ 4.0 1 1,386

Hash Right Join (cost=100.17..139.00 rows=4 width=80) (actual time=3.229..5.291 rows=1 loops=1,386)

  • Hash Cond: (operadora_multitenant_convenio.id = operadoraoriginalconvenio.id_multitenant)
117. 7,236.306 7,236.306 ↑ 8.1 105 1,386

Foreign Scan on operadora_multitenant operadora_multitenant_convenio (cost=100.00..135.59 rows=853 width=72) (actual time=3.160..5.221 rows=105 loops=1,386)

118. 8.316 27.720 ↑ 1.0 1 1,386

Hash (cost=0.16..0.16 rows=1 width=24) (actual time=0.020..0.020 rows=1 loops=1,386)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
119. 19.404 19.404 ↑ 1.0 1 1,386

Index Scan using fibooperadora_pkey on fibooperadora operadoraoriginalconvenio (cost=0.14..0.16 rows=1 width=24) (actual time=0.013..0.014 rows=1 loops=1,386)

  • Index Cond: (guiaconvenio.guioperadoraoriginal = id)
120. 2.772 2.772 ↓ 0.0 0 1,386

Index Scan using fibooperadora_pkey on fibooperadora operadoraoriginalcobrancaoriginal (cost=0.14..0.16 rows=1 width=24) (actual time=0.002..0.002 rows=0 loops=1,386)

  • Index Cond: (guiacobrancaoriginal.guioperadoraoriginal = id)
121. 1.386 1.386 ↓ 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.001..0.001 rows=0 loops=1,386)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
122. 40.194 40.194 ↑ 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.028..0.029 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
123. 2.772 2.772 ↓ 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.002..0.002 rows=0 loops=1,386)

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

SubPlan (forHash Right Join)

125. 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))
126. 0.290 0.290 ↑ 1.0 565 1

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

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
127. 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
128. 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
129. 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)

130. 1.161 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)

131. 0.000 2.772 ↓ 0.0 0 1,386

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

132. 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)
133. 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)
134. 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)
135. 0.000 2.772 ↑ 1.0 1 1,386

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

136. 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)
137. 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)
138.          

Initplan (forIndex Scan)

139. 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)
140. 1.386 4.158 ↑ 1.0 1 1,386

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

141. 2.772 2.772 ↓ 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.002..0.002 rows=0 loops=1,386)

  • Index Cond: (guicobrancaoriginal = guiaprestador.id)
  • Filter: (guisituacaoguia = 'PosAuditoria'::text)
  • Rows Removed by Filter: 0
142. 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
143. 0.005 0.005 ↓ 0.0 0 1

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

Planning time : 36.272 ms
Execution time : 12,086.657 ms