explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qrL5

Settings
# exclusive inclusive rows x rows loops node
1. 0.087 1,246.359 ↑ 1.0 100 1

Limit (cost=44,342,721.35..44,342,721.60 rows=100 width=3,022) (actual time=1,246.255..1,246.359 rows=100 loops=1)

2. 20.047 1,246.272 ↑ 5,048.1 100 1

Sort (cost=44,342,721.35..44,343,983.38 rows=504,814 width=3,022) (actual time=1,246.254..1,246.272 rows=100 loops=1)

  • Sort Key: (COALESCE(round((COALESCE(guiaconvenio_1.guivalortotal, '0'::numeric) - COALESCE(guiaprestador_1.guivalortotal, '0'::numeric)), 4), '0'::numeric))
  • Sort Method: top-N heapsort Memory: 226kB
3. 59.441 1,226.225 ↑ 79.4 6,357 1

WindowAgg (cost=98,348.00..44,318,379.58 rows=504,814 width=3,022) (actual time=1,202.821..1,226.225 rows=6,357 loops=1)

4. 102.755 1,166.784 ↑ 79.4 6,357 1

Hash Left Join (cost=98,348.00..44,276,732.42 rows=504,814 width=2,620) (actual time=795.994..1,166.784 rows=6,357 loops=1)

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

Initplan (forHash Left Join)

6. 0.035 0.035 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 3.965 993.046 ↑ 18.6 6,357 1

Hash Left Join (cost=98,197.37..367,844.00 rows=118,362 width=1,818) (actual time=788.042..993.046 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.id = pendencia.guia_id)
8. 7.764 989.077 ↑ 18.6 6,357 1

Hash Left Join (cost=98,180.17..367,382.64 rows=118,362 width=1,778) (actual time=788.023..989.077 rows=6,357 loops=1)

  • Hash Cond: ((guiaprestador.guinumconta = sincronia_recursos_aceites_erp.numero_conta) AND (remessa.rem_numero = sincronia_recursos_aceites_erp.remessa))
  • 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 CASE WHEN (sincronia_recursos_aceites_erp.guia_de_recurso IS TRUE) THEN (guiaprestador.discriminador = 'RECURSO'::text) ELSE (guiaprestador.discriminador = 'PRESTADOR'::text) END)
  • Rows Removed by Join Filter: 140
9. 4.345 934.559 ↑ 18.6 6,357 1

Hash Left Join (cost=94,353.54..360,301.04 rows=118,362 width=1,743) (actual time=740.866..934.559 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.id_lote_recurso = lote_recurso.id)
10. 3.804 919.804 ↑ 18.6 6,357 1

Hash Left Join (cost=92,755.95..358,187.64 rows=118,362 width=1,673) (actual time=730.362..919.804 rows=6,357 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadoraoriginalcobrancaoriginal.id)
11. 4.692 915.949 ↑ 18.6 6,357 1

Hash Left Join (cost=92,750.61..356,721.32 rows=118,362 width=1,657) (actual time=730.296..915.949 rows=6,357 loops=1)

  • Hash Cond: (operadoraoriginalconvenio.id_multitenant = operadora_multitenant_convenio.id)
12. 5.785 904.500 ↑ 4.4 6,357 1

Nested Loop Left Join (cost=92,604.36..352,373.42 rows=27,752 width=1,601) (actual time=723.519..904.500 rows=6,357 loops=1)

13. 4.308 898.715 ↑ 4.4 6,357 1

Hash Left Join (cost=92,603.94..339,268.80 rows=27,752 width=1,584) (actual time=723.512..898.715 rows=6,357 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guiremessa = remessacobrancaoriginal.id)
14. 6.092 866.261 ↑ 4.4 6,357 1

Nested Loop Left Join (cost=90,051.64..336,460.51 rows=27,752 width=1,561) (actual time=695.190..866.261 rows=6,357 loops=1)

15. 4.472 860.169 ↑ 4.4 6,357 1

Hash Left Join (cost=90,051.22..317,781.41 rows=27,752 width=1,491) (actual time=695.186..860.169 rows=6,357 loops=1)

  • Hash Cond: (guiaconvenio.recebimento_id = recebimento.id)
16. 4.742 855.021 ↑ 4.4 6,357 1

Hash Left Join (cost=89,952.71..317,463.96 rows=27,752 width=1,487) (actual time=694.497..855.021 rows=6,357 loops=1)

  • Hash Cond: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.id)
17. 4.553 850.240 ↑ 4.4 6,357 1

Hash Left Join (cost=89,947.37..317,116.07 rows=27,752 width=1,471) (actual time=694.449..850.240 rows=6,357 loops=1)

  • Hash Cond: (guiaconvenio.guiprestoriginal = prestadororiginalconvenio.id)
18. 4.443 845.351 ↑ 4.4 6,357 1

Hash Left Join (cost=89,899.38..316,927.10 rows=27,752 width=1,438) (actual time=694.104..845.351 rows=6,357 loops=1)

  • Hash Cond: (protocoloconvenio.hospital = hospitalconvenio.id)
19. 7.548 840.904 ↑ 4.4 6,357 1

Nested Loop Left Join (cost=89,898.35..316,544.48 rows=27,752 width=1,395) (actual time=694.088..840.904 rows=6,357 loops=1)

20. 3.809 820.642 ↑ 4.4 6,357 1

Hash Left Join (cost=89,897.93..303,382.99 rows=27,752 width=1,361) (actual time=694.067..820.642 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guistatusanaliseglosa = statusconvenioanalise.stcodigo)
21. 4.779 816.824 ↑ 4.4 6,357 1

Hash Left Join (cost=89,896.59..303,218.56 rows=27,752 width=1,348) (actual time=694.050..816.824 rows=6,357 loops=1)

  • Hash Cond: (guiaconvenio.guistatusconciliacao = statusconvenioconciliacao.stcodigo)
22. 4.738 812.036 ↑ 4.4 6,357 1

Hash Left Join (cost=89,895.26..302,835.63 rows=27,752 width=1,335) (actual time=694.034..812.036 rows=6,357 loops=1)

  • Hash Cond: (guiaconvenio.guisituacaoguia = situacaoconvenio.sitcodigo)
23. 3.614 807.284 ↑ 4.4 6,357 1

Hash Left Join (cost=89,893.69..302,452.48 rows=27,752 width=1,319) (actual time=694.004..807.284 rows=6,357 loops=1)

  • Hash Cond: (guiaconvenio.guimotglosa = motivoglosaconvenio.id)
24. 4.726 803.354 ↑ 4.4 6,357 1

Hash Left Join (cost=89,852.90..302,307.60 rows=27,752 width=1,276) (actual time=693.680..803.354 rows=6,357 loops=1)

  • Hash Cond: (guiaconvenio.guicompetencia = competenciaconvenio.id)
25. 4.167 798.392 ↑ 4.4 6,357 1

Nested Loop Left Join (cost=89,821.83..301,894.95 rows=27,752 width=1,258) (actual time=693.438..798.392 rows=6,357 loops=1)

26. 5.167 775.154 ↑ 4.4 6,357 1

Nested Loop Left Join (cost=89,821.41..288,790.33 rows=27,752 width=1,226) (actual time=693.430..775.154 rows=6,357 loops=1)

27. 4.201 769.987 ↑ 4.4 6,357 1

Nested Loop Left Join (cost=89,820.98..270,111.23 rows=27,752 width=1,228) (actual time=693.427..769.987 rows=6,357 loops=1)

28. 4.582 753.072 ↑ 4.4 6,357 1

Hash Left Join (cost=89,820.56..251,432.13 rows=27,752 width=1,204) (actual time=693.419..753.072 rows=6,357 loops=1)

  • Hash Cond: (protocoloprestador.hospital = hospitalprestador.id)
29. 3.059 748.479 ↑ 4.4 6,357 1

Nested Loop Left Join (cost=89,819.53..251,049.52 rows=27,752 width=1,161) (actual time=693.394..748.479 rows=6,357 loops=1)

30. 118.717 726.349 ↑ 4.4 6,357 1

Merge Right Join (cost=89,819.11..237,888.03 rows=27,752 width=1,161) (actual time=693.367..726.349 rows=6,357 loops=1)

  • Merge Cond: (guiaconvenio.id = (COALESCE(guiaconvenio_1.id, guiaprestador_1.guiguiaassoc)))
31. 417.589 417.589 ↑ 1.2 1,057,810 1

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..144,411.80 rows=1,268,754 width=347) (actual time=0.009..417.589 rows=1,057,810 loops=1)

32. 1.353 190.043 ↑ 4.4 6,357 1

Materialize (cost=89,818.68..89,957.44 rows=27,752 width=830) (actual time=186.061..190.043 rows=6,357 loops=1)

33. 14.467 188.690 ↑ 4.4 6,357 1

Sort (cost=89,818.68..89,888.06 rows=27,752 width=830) (actual time=186.057..188.690 rows=6,357 loops=1)

  • Sort Key: (COALESCE(guiaconvenio_1.id, guiaprestador_1.guiguiaassoc))
  • Sort Method: quicksort Memory: 6614kB
34. 3.162 174.223 ↑ 4.4 6,357 1

Hash Left Join (cost=8,592.74..77,620.54 rows=27,752 width=830) (actual time=74.485..174.223 rows=6,357 loops=1)

  • Hash Cond: (operadoraoriginalprestador.id_multitenant = operadora_multitenant_prestador.id)
35. 2.672 161.407 ↑ 1.0 6,357 1

Hash Left Join (cost=8,446.49..76,489.13 rows=6,507 width=774) (actual time=64.814..161.407 rows=6,357 loops=1)

  • Hash Cond: ((competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio) AND (remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa))
36. 2.253 155.236 ↑ 1.0 6,357 1

Nested Loop Left Join (cost=7,792.54..75,786.24 rows=6,507 width=763) (actual time=61.282..155.236 rows=6,357 loops=1)

37. 2.815 146.626 ↑ 1.0 6,357 1

Hash Left Join (cost=7,792.12..72,830.91 rows=6,507 width=741) (actual time=61.261..146.626 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guioperadoraoriginal = operadoraoriginalprestador.id)
38. 1.968 143.770 ↑ 1.0 6,357 1

Hash Left Join (cost=7,786.78..72,745.25 rows=6,507 width=725) (actual time=61.211..143.770 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guiprestoriginal = prestadororiginalprestador.id)
39. 2.294 141.453 ↑ 1.0 6,357 1

Hash Left Join (cost=7,738.78..72,664.20 rows=6,507 width=692) (actual time=60.853..141.453 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
40. 3.001 139.152 ↑ 1.0 6,357 1

Hash Left Join (cost=7,737.44..72,624.62 rows=6,507 width=679) (actual time=60.835..139.152 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
41. 2.890 136.142 ↑ 1.0 6,357 1

Hash Left Join (cost=7,736.11..72,533.81 rows=6,507 width=666) (actual time=60.817..136.142 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
42. 2.834 133.239 ↑ 1.0 6,357 1

Hash Left Join (cost=7,734.54..72,442.78 rows=6,507 width=650) (actual time=60.796..133.239 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
43. 1.965 130.388 ↑ 1.0 6,357 1

Hash Left Join (cost=7,732.98..72,351.74 rows=6,507 width=634) (actual time=60.753..130.388 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guimotglosa = motivoglosaprestador.id)
44. 2.680 128.102 ↑ 1.0 6,357 1

Hash Left Join (cost=7,692.19..72,286.54 rows=6,507 width=591) (actual time=60.426..128.102 rows=6,357 loops=1)

  • Hash Cond: (guiaprestador.guicompetencia = competenciaprestador.id)
45. 6.535 125.183 ↑ 1.0 6,357 1

Nested Loop Left Join (cost=7,661.12..72,166.00 rows=6,507 width=573) (actual time=60.178..125.183 rows=6,357 loops=1)

46. 0.834 112.291 ↑ 1.0 6,357 1

Nested Loop Left Join (cost=7,660.83..70,070.82 rows=6,507 width=523) (actual time=60.160..112.291 rows=6,357 loops=1)

47. 6.499 92.386 ↑ 1.0 6,357 1

Nested Loop Left Join (cost=7,660.41..66,998.18 rows=6,507 width=470) (actual time=60.140..92.386 rows=6,357 loops=1)

48. 3.362 73.173 ↑ 1.0 6,357 1

Hash Full Join (cost=7,659.98..21,681.81 rows=6,507 width=53) (actual time=60.127..73.173 rows=6,357 loops=1)

  • Hash Cond: (guiaconvenio_1.id = guiaprestador_1.guiguiaassoc)
49. 2.489 9.726 ↑ 1.0 6,357 1

Nested Loop (cost=0.70..13,998.12 rows=6,507 width=23) (actual time=0.028..9.726 rows=6,357 loops=1)

50. 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)
51. 7.228 7.228 ↑ 1.0 6,357 1

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaconvenio_1 (cost=0.43..13,924.76 rows=6,507 width=31) (actual time=0.018..7.228 rows=6,357 loops=1)

  • Index Cond: (guicompetencia = '329678849'::bigint)
  • Filter: (guiorigem = 'CONVENIO'::text)
  • Rows Removed by Filter: 6926
52. 1.899 60.085 ↓ 60.2 6,320 1

Hash (cost=7,657.97..7,657.97 rows=105 width=30) (actual time=60.085..60.085 rows=6,320 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 473kB
53. 2.715 58.186 ↓ 60.2 6,320 1

Nested Loop (cost=263.28..7,657.97 rows=105 width=30) (actual time=31.880..58.186 rows=6,320 loops=1)

54. 0.409 0.409 ↑ 1.0 23 1

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaprestador_1 (cost=0.28..54.84 rows=23 width=8) (actual time=0.010..0.409 rows=23 loops=1)

  • Filter: (comp_convenio = 'SulAmerica'::text)
  • Rows Removed by Filter: 780
55. 9.062 55.062 ↓ 55.0 275 23

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=263.00..330.52 rows=5 width=38) (actual time=2.156..2.394 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
56. 2.852 46.000 ↓ 0.0 0 23

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

57. 20.056 20.056 ↓ 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.872..0.872 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
58. 23.092 23.092 ↓ 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.004..1.004 rows=12,278 loops=23)

  • Index Cond: (guicompetenciaassoc = '329678849'::bigint)
59. 12.714 12.714 ↑ 1.0 1 6,357

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=0.43..6.95 rows=1 width=433) (actual time=0.002..0.002 rows=1 loops=6,357)

  • Index Cond: (COALESCE(guiaprestador_1.id, guiaconvenio_1.guiguiaassoc) = id)
60. 19.071 19.071 ↑ 1.0 1 6,357

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

  • Index Cond: (guiaprestador.guibenefic = id)
61. 6.357 6.357 ↑ 1.0 1 6,357

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

  • Index Cond: (guiaprestador.guiremessa = id)
62. 0.110 0.239 ↑ 1.0 803 1

Hash (cost=21.03..21.03 rows=803 width=26) (actual time=0.239..0.239 rows=803 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 54kB
63. 0.129 0.129 ↑ 1.0 803 1

Seq Scan on fibocompetencia competenciaprestador (cost=0.00..21.03 rows=803 width=26) (actual time=0.007..0.129 rows=803 loops=1)

64. 0.154 0.321 ↑ 1.0 1,013 1

Hash (cost=28.13..28.13 rows=1,013 width=59) (actual time=0.321..0.321 rows=1,013 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 102kB
65. 0.167 0.167 ↑ 1.0 1,013 1

Seq Scan on fibodefinicaomotivoglosa motivoglosaprestador (cost=0.00..28.13 rows=1,013 width=59) (actual time=0.007..0.167 rows=1,013 loops=1)

66. 0.010 0.017 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=30) (actual time=0.017..0.017 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
67. 0.007 0.007 ↑ 1.0 25 1

Seq Scan on fibosituacaoguia situacaoinicialprestador (cost=0.00..1.25 rows=25 width=30) (actual time=0.004..0.007 rows=25 loops=1)

68. 0.009 0.013 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=30) (actual time=0.013..0.013 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
69. 0.004 0.004 ↑ 1.0 25 1

Seq Scan on fibosituacaoguia situacaoassociacaoprestador (cost=0.00..1.25 rows=25 width=30) (actual time=0.002..0.004 rows=25 loops=1)

70. 0.005 0.009 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=25) (actual time=0.009..0.009 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
71. 0.004 0.004 ↑ 1.0 15 1

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

72. 0.004 0.007 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=25) (actual time=0.007..0.007 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
73. 0.003 0.003 ↑ 1.0 15 1

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

74. 0.233 0.349 ↑ 1.0 1,511 1

Hash (cost=29.11..29.11 rows=1,511 width=41) (actual time=0.349..0.349 rows=1,511 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 125kB
75. 0.116 0.116 ↑ 1.0 1,511 1

Seq Scan on fiboprestador prestadororiginalprestador (cost=0.00..29.11 rows=1,511 width=41) (actual time=0.004..0.116 rows=1,511 loops=1)

76. 0.019 0.041 ↑ 1.0 104 1

Hash (cost=4.04..4.04 rows=104 width=24) (actual time=0.041..0.041 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
77. 0.022 0.022 ↑ 1.0 104 1

Seq Scan on fibooperadora operadoraoriginalprestador (cost=0.00..4.04 rows=104 width=24) (actual time=0.004..0.022 rows=104 loops=1)

78. 6.357 6.357 ↓ 0.0 0 6,357

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

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
79. 1.089 3.499 ↑ 1.0 4,318 1

Hash (cost=589.18..589.18 rows=4,318 width=26) (actual time=3.499..3.499 rows=4,318 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 299kB
80. 2.410 2.410 ↑ 1.0 4,318 1

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

81. 0.026 9.654 ↑ 8.1 105 1

Hash (cost=135.59..135.59 rows=853 width=72) (actual time=9.654..9.654 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
82. 9.628 9.628 ↑ 8.1 105 1

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

83. 19.071 19.071 ↑ 1.0 1 6,357

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloprestador (cost=0.42..0.46 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=6,357)

  • Index Cond: (guiaprestador.guiprotocolo = id)
84. 0.003 0.011 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=51) (actual time=0.011..0.011 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
85. 0.008 0.008 ↑ 1.0 1 1

Seq Scan on fibohospital hospitalprestador (cost=0.00..1.01 rows=1 width=51) (actual time=0.007..0.008 rows=1 loops=1)

86. 12.714 12.714 ↓ 0.0 0 6,357

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=0 loops=6,357)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
87. 0.000 0.000 ↓ 0.0 0 6,357

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

  • Index Cond: (id = guiarecurso.guiguiaassoc)
88. 19.071 19.071 ↑ 1.0 1 6,357

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=48) (actual time=0.003..0.003 rows=1 loops=6,357)

  • Index Cond: (guiaconvenio.guibenefic = id)
89. 0.116 0.236 ↑ 1.0 803 1

Hash (cost=21.03..21.03 rows=803 width=26) (actual time=0.236..0.236 rows=803 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 54kB
90. 0.120 0.120 ↑ 1.0 803 1

Seq Scan on fibocompetencia competenciaconvenio (cost=0.00..21.03 rows=803 width=26) (actual time=0.005..0.120 rows=803 loops=1)

91. 0.174 0.316 ↑ 1.0 1,013 1

Hash (cost=28.13..28.13 rows=1,013 width=59) (actual time=0.316..0.316 rows=1,013 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 102kB
92. 0.142 0.142 ↑ 1.0 1,013 1

Seq Scan on fibodefinicaomotivoglosa motivoglosaconvenio (cost=0.00..28.13 rows=1,013 width=59) (actual time=0.006..0.142 rows=1,013 loops=1)

93. 0.006 0.014 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=30) (actual time=0.014..0.014 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
94. 0.008 0.008 ↑ 1.0 25 1

Seq Scan on fibosituacaoguia situacaoconvenio (cost=0.00..1.25 rows=25 width=30) (actual time=0.004..0.008 rows=25 loops=1)

95. 0.005 0.009 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=25) (actual time=0.009..0.009 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
96. 0.004 0.004 ↑ 1.0 15 1

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

97. 0.005 0.009 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=25) (actual time=0.009..0.009 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
98. 0.004 0.004 ↑ 1.0 15 1

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

99. 12.714 12.714 ↑ 1.0 1 6,357

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

  • Index Cond: (guiaconvenio.guiprotocolo = id)
100. 0.002 0.004 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=51) (actual time=0.004..0.004 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
101. 0.002 0.002 ↑ 1.0 1 1

Seq Scan on fibohospital hospitalconvenio (cost=0.00..1.01 rows=1 width=51) (actual time=0.002..0.002 rows=1 loops=1)

102. 0.219 0.336 ↑ 1.0 1,511 1

Hash (cost=29.11..29.11 rows=1,511 width=41) (actual time=0.336..0.336 rows=1,511 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 125kB
103. 0.117 0.117 ↑ 1.0 1,511 1

Seq Scan on fiboprestador prestadororiginalconvenio (cost=0.00..29.11 rows=1,511 width=41) (actual time=0.004..0.117 rows=1,511 loops=1)

104. 0.013 0.039 ↑ 1.0 104 1

Hash (cost=4.04..4.04 rows=104 width=24) (actual time=0.039..0.039 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
105. 0.026 0.026 ↑ 1.0 104 1

Seq Scan on fibooperadora operadoraoriginalconvenio (cost=0.00..4.04 rows=104 width=24) (actual time=0.003..0.026 rows=104 loops=1)

106. 0.261 0.676 ↑ 1.0 1,889 1

Hash (cost=74.89..74.89 rows=1,889 width=12) (actual time=0.676..0.676 rows=1,889 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 105kB
107. 0.415 0.415 ↑ 1.0 1,889 1

Seq Scan on recebimento (cost=0.00..74.89 rows=1,889 width=12) (actual time=0.007..0.415 rows=1,889 loops=1)

108. 0.000 0.000 ↓ 0.0 0 6,357

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

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
109. 12.603 28.146 ↑ 1.0 57,213 1

Hash (cost=1,837.13..1,837.13 rows=57,213 width=39) (actual time=28.146..28.146 rows=57,213 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 4935kB
110. 15.543 15.543 ↑ 1.0 57,213 1

Seq Scan on fiboremessa remessacobrancaoriginal (cost=0.00..1,837.13 rows=57,213 width=39) (actual time=0.008..15.543 rows=57,213 loops=1)

111. 0.000 0.000 ↓ 0.0 0 6,357

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

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
112. 0.035 6.757 ↑ 8.1 105 1

Hash (cost=135.59..135.59 rows=853 width=72) (actual time=6.757..6.757 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
113. 6.722 6.722 ↑ 8.1 105 1

Foreign Scan on operadora_multitenant operadora_multitenant_convenio (cost=100.00..135.59 rows=853 width=72) (actual time=5.103..6.722 rows=105 loops=1)

114. 0.023 0.051 ↑ 1.0 104 1

Hash (cost=4.04..4.04 rows=104 width=24) (actual time=0.051..0.051 rows=104 loops=1)

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

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

116. 4.409 10.410 ↑ 1.0 21,004 1

Hash (cost=1,335.04..1,335.04 rows=21,004 width=78) (actual time=10.410..10.410 rows=21,004 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1652kB
117. 6.001 6.001 ↑ 1.0 21,004 1

Seq Scan on lote_recurso (cost=0.00..1,335.04 rows=21,004 width=78) (actual time=0.006..6.001 rows=21,004 loops=1)

118. 23.569 46.754 ↑ 1.0 87,465 1

Hash (cost=2,514.65..2,514.65 rows=87,465 width=63) (actual time=46.754..46.754 rows=87,465 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 8717kB
119. 23.185 23.185 ↑ 1.0 87,465 1

Seq Scan on sincronia_recursos_aceites_erp (cost=0.00..2,514.65 rows=87,465 width=63) (actual time=0.009..23.185 rows=87,465 loops=1)

120. 0.000 0.004 ↓ 0.0 0 1

Hash (cost=13.20..13.20 rows=320 width=48) (actual time=0.004..0.004 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
121. 0.004 0.004 ↓ 0.0 0 1

Seq Scan on pendencia (cost=0.00..13.20 rows=320 width=48) (actual time=0.004..0.004 rows=0 loops=1)

122. 0.068 7.079 ↑ 8.1 105 1

Hash (cost=135.59..135.59 rows=853 width=72) (actual time=7.079..7.079 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
123. 7.011 7.011 ↑ 8.1 105 1

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

124.          

SubPlan (forHash Left 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.295 0.295 ↑ 1.0 565 1

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

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
127. 12.714 12.714 ↓ 0.0 0 6,357

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

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
128. 6.357 6.357 ↓ 0.0 0 6,357

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

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
129. 6.357 19.071 ↑ 1.0 1 6,357

Aggregate (cost=17.33..17.34 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=6,357)

130. 0.000 12.714 ↓ 0.0 0 6,357

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

131. 5.877 12.714 ↓ 0.0 0 6,357

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

132. 6.357 6.357 ↓ 0.0 0 6,357

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

  • Index Cond: (id_guia = guiaconvenio.id)
133. 0.480 0.480 ↑ 1.0 1 120

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

  • Index Cond: (id = glosasguia.elt)
134. 0.360 0.360 ↑ 1.0 1 120

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

  • Index Cond: (id = glosas.glo_motivo)
135. 0.000 12.714 ↑ 1.0 1 6,357

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

136. 12.714 12.714 ↓ 0.0 0 6,357

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

  • Index Cond: (guia_convenio_id = guiaconvenio.id)
137. 0.000 0.000 ↓ 0.0 0 6,357

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

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

Initplan (forIndex Scan)

139. 0.000 0.000 ↓ 0.0 0 6,357

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

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
140. 0.000 12.714 ↑ 1.0 1 6,357

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

141. 12.714 12.714 ↓ 0.0 0 6,357

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

  • 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.004 0.004 ↓ 0.0 0 1

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

Planning time : 43.825 ms
Execution time : 1,336.058 ms