explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 69rW

Settings
# exclusive inclusive rows x rows loops node
1. 2.367 18,633.213 ↑ 1.0 100 1

Limit (cost=5,238,450.87..5,238,500.87 rows=100 width=3,196) (actual time=18,630.377..18,633.213 rows=100 loops=1)

  • Buffers: shared hit=605846 read=2165
2. 86.288 18,630.846 ↑ 18.9 100 1

Sort (cost=5,238,450.87..5,239,397.87 rows=1,894 width=3,196) (actual time=18,630.359..18,630.846 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
  • Buffers: shared hit=605846 read=2165
3. 220.423 18,544.558 ↓ 8.3 15,657 1

WindowAgg (cost=336,526.68..5,223,026.41 rows=1,894 width=3,196) (actual time=18,449.082..18,544.558 rows=15,657 loops=1)

  • Buffers: shared hit=605846 read=2165
4. 1,095.441 18,324.135 ↓ 8.3 15,657 1

Hash Left Join (cost=336,526.68..5,197,457.41 rows=1,894 width=2,794) (actual time=3,491.636..18,324.135 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.id = pendencia.guia_id)
  • Buffers: shared hit=605846 read=2165
5.          

Initplan (forHash Left Join)

6. 0.035 0.035 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 83
  • Buffers: shared hit=3
7. 162.966 15,660.988 ↓ 8.3 15,657 1

Hash Left Join (cost=335,907.18..2,443,379.22 rows=1,894 width=2,028) (actual time=3,487.532..15,660.988 rows=15,657 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)
  • Buffers: shared hit=405451 read=2165
8. 162.602 15,497.999 ↓ 8.3 15,657 1

Hash Left Join (cost=335,457.18..2,420,199.22 rows=1,894 width=1,954) (actual time=3,487.497..15,497.999 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.id_lote_recurso = lote_recurso.id)
  • Buffers: shared hit=405451 read=2165
9. 161.639 15,307.514 ↓ 8.3 15,657 1

Hash Left Join (cost=331,053.18..2,414,800.87 rows=1,894 width=1,833) (actual time=3,459.590..15,307.514 rows=15,657 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadoraoriginalcobrancaoriginal.id)
  • Buffers: shared hit=405412 read=2165
10. 245.415 15,145.526 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=330,998.18..2,413,720.34 rows=1,894 width=1,809) (actual time=3,459.228..15,145.526 rows=15,657 loops=1)

  • Buffers: shared hit=405411 read=2165
11. 162.352 14,821.826 ↓ 8.3 15,657 1

Hash Left Join (cost=330,914.68..2,248,750.38 rows=1,894 width=1,791) (actual time=3,459.186..14,821.826 rows=15,657 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guiremessa = remessacobrancaoriginal.id)
  • Buffers: shared hit=399747 read=2165
12. 247.536 14,578.797 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=318,211.68..2,235,053.03 rows=1,894 width=1,766) (actual time=3,378.485..14,578.797 rows=15,657 loops=1)

  • Buffers: shared hit=399569 read=2165
13. 162.999 14,252.976 ↓ 8.3 15,657 1

Hash Left Join (cost=318,127.18..2,068,163.50 rows=1,894 width=1,688) (actual time=3,378.455..14,252.976 rows=15,657 loops=1)

  • Hash Cond: (guiaconvenio.recebimento_id = recebimento.id)
  • Buffers: shared hit=393908 read=2165
14. 162.179 14,071.729 ↓ 8.3 15,657 1

Hash Left Join (cost=315,254.68..2,064,296.65 rows=1,894 width=1,684) (actual time=3,360.189..14,071.729 rows=15,657 loops=1)

  • Hash Cond: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.id)
  • Buffers: shared hit=393854 read=2165
15. 162.780 13,909.141 ↓ 8.3 15,657 1

Hash Left Join (cost=315,199.68..2,063,216.12 rows=1,894 width=1,660) (actual time=3,359.765..13,909.141 rows=15,657 loops=1)

  • Hash Cond: (guiaconvenio.guiprestoriginal = prestadororiginalconvenio.id)
  • Buffers: shared hit=393853 read=2165
16. 162.294 13,717.629 ↓ 8.3 15,657 1

Hash Left Join (cost=310,826.18..2,057,848.27 rows=1,894 width=1,635) (actual time=3,331.013..13,717.629 rows=15,657 loops=1)

  • Hash Cond: (protocoloconvenio.hospital = hospitalconvenio.id)
  • Buffers: shared hit=393828 read=2165
17. 249.635 13,555.281 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=310,823.68..2,055,478.27 rows=1,894 width=1,598) (actual time=3,330.941..13,555.281 rows=15,657 loops=1)

  • Buffers: shared hit=393827 read=2165
18. 161.875 13,227.361 ↓ 8.3 15,657 1

Hash Left Join (cost=310,765.18..1,937,861.36 rows=1,894 width=1,563) (actual time=3,330.905..13,227.361 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guistatusanaliseglosa = statusconvenioanalise.stcodigo)
  • Buffers: shared hit=346814 read=2165
19. 161.651 13,065.302 ↓ 8.3 15,657 1

Hash Left Join (cost=310,741.68..1,936,818.86 rows=1,894 width=1,550) (actual time=3,330.707..13,065.302 rows=15,657 loops=1)

  • Hash Cond: (guiaconvenio.guistatusconciliacao = statusconvenioconciliacao.stcodigo)
  • Buffers: shared hit=346813 read=2165
20. 161.773 12,903.492 ↓ 8.3 15,657 1

Hash Left Join (cost=310,718.18..1,935,709.66 rows=1,894 width=1,537) (actual time=3,330.537..12,903.492 rows=15,657 loops=1)

  • Hash Cond: (guiaconvenio.guisituacaoguia = situacaoconvenio.sitcodigo)
  • Buffers: shared hit=346812 read=2165
21. 161.477 12,741.470 ↓ 8.3 15,657 1

Hash Left Join (cost=310,679.68..1,934,621.71 rows=1,894 width=1,521) (actual time=3,330.276..12,741.470 rows=15,657 loops=1)

  • Hash Cond: (guiaconvenio.guimotglosa = motivoglosaconvenio.id)
  • Buffers: shared hit=346811 read=2165
22. 162.796 12,570.193 ↓ 8.3 15,657 1

Hash Left Join (cost=309,127.68..1,932,075.36 rows=1,894 width=1,478) (actual time=3,320.465..12,570.193 rows=15,657 loops=1)

  • Hash Cond: (guiaconvenio.guicompetencia = competenciaconvenio.id)
  • Buffers: shared hit=346792 read=2165
23. 239.353 12,396.000 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=307,326.68..1,929,278.56 rows=1,894 width=1,460) (actual time=3,309.055..12,396.000 rows=15,657 loops=1)

  • Buffers: shared hit=346773 read=2165
24. 245.312 12,062.705 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=307,243.18..1,764,308.59 rows=1,894 width=1,427) (actual time=3,309.028..12,062.705 rows=15,657 loops=1)

  • Buffers: shared hit=284111 read=2165
25. 245.374 11,723.451 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=307,158.68..1,597,396.26 rows=1,894 width=1,054) (actual time=3,308.998..11,723.451 rows=15,657 loops=1)

  • Buffers: shared hit=221438 read=2165
26. 250.556 11,399.792 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=307,074.18..1,430,506.74 rows=1,894 width=1,056) (actual time=3,308.974..11,399.792 rows=15,657 loops=1)

  • Buffers: shared hit=212465 read=2165
27. 161.889 11,070.951 ↓ 8.3 15,657 1

Hash Left Join (cost=306,989.68..1,263,617.21 rows=1,894 width=1,040) (actual time=3,308.951..11,070.951 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.id = obs_rec_guia.guia_hospital_id)
  • Buffers: shared hit=201081 read=2165
28. 161.502 10,909.039 ↓ 8.3 15,657 1

Hash Left Join (cost=306,574.68..1,262,207.86 rows=1,894 width=864) (actual time=3,308.918..10,909.039 rows=15,657 loops=1)

  • Hash Cond: (protocoloprestador.hospital = hospitalprestador.id)
  • Buffers: shared hit=201081 read=2165
29. 234.571 10,747.477 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=306,572.18..1,259,837.86 rows=1,894 width=827) (actual time=3,308.874..10,747.477 rows=15,657 loops=1)

  • Buffers: shared hit=201080 read=2165
30. 161.624 10,418.964 ↓ 8.3 15,657 1

Hash Left Join (cost=306,513.68..1,142,220.95 rows=1,894 width=827) (actual time=3,308.845..10,418.964 rows=15,657 loops=1)

  • Hash Cond: ((competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio) AND (remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa))
  • Buffers: shared hit=161812 read=2165
31. 161.720 10,257.317 ↓ 8.3 15,657 1

Hash Left Join (cost=306,103.68..1,139,822.25 rows=1,894 width=795) (actual time=3,308.811..10,257.317 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.gui_quitacao_sistema_gestao = quitacao_sistema_gestao.id)
  • Buffers: shared hit=161812 read=2165
32. 162.258 10,085.679 ↓ 8.3 15,657 1

Hash Left Join (cost=304,688.68..1,137,412.90 rows=1,894 width=774) (actual time=3,298.882..10,085.679 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guioperadoraoriginal = operadoraoriginalprestador.id)
  • Buffers: shared hit=161801 read=2165
33. 161.654 9,923.072 ↓ 8.3 15,657 1

Hash Left Join (cost=304,633.68..1,136,332.37 rows=1,894 width=750) (actual time=3,298.521..9,923.072 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guiprestoriginal = prestadororiginalprestador.id)
  • Buffers: shared hit=161800 read=2165
34. 161.744 9,726.498 ↓ 8.3 15,657 1

Hash Left Join (cost=300,260.18..1,130,964.52 rows=1,894 width=725) (actual time=3,263.584..9,726.498 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
  • Buffers: shared hit=161775 read=2165
35. 162.033 9,564.596 ↓ 8.3 15,657 1

Hash Left Join (cost=300,236.68..1,129,922.02 rows=1,894 width=712) (actual time=3,263.410..9,564.596 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
  • Buffers: shared hit=161774 read=2165
36. 162.190 9,402.264 ↓ 8.3 15,657 1

Hash Left Join (cost=300,213.18..1,128,812.82 rows=1,894 width=699) (actual time=3,263.097..9,402.264 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
  • Buffers: shared hit=161773 read=2165
37. 162.214 9,239.629 ↓ 8.3 15,657 1

Hash Left Join (cost=300,174.68..1,127,724.87 rows=1,894 width=683) (actual time=3,262.637..9,239.629 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
  • Buffers: shared hit=161772 read=2165
38. 160.993 9,077.165 ↓ 8.3 15,657 1

Hash Left Join (cost=300,136.18..1,126,636.92 rows=1,894 width=667) (actual time=3,262.374..9,077.165 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guimotglosa = motivoglosaprestador.id)
  • Buffers: shared hit=161771 read=2165
39. 161.726 8,906.022 ↓ 8.3 15,657 1

Hash Left Join (cost=298,584.18..1,124,090.57 rows=1,894 width=624) (actual time=3,252.208..8,906.022 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guicompetencia = competenciaprestador.id)
  • Buffers: shared hit=161752 read=2165
40. 162.055 8,731.556 ↓ 8.3 15,657 1

Hash Left Join (cost=296,783.18..1,121,293.77 rows=1,894 width=606) (actual time=3,239.451..8,731.556 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador.guiremessa = remessa.id)
  • Buffers: shared hit=161733 read=2165
41. 240.115 8,486.370 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=284,080.18..1,107,596.42 rows=1,894 width=554) (actual time=3,156.299..8,486.370 rows=15,657 loops=1)

  • Buffers: shared hit=161555 read=2165
42. 249.535 8,152.313 ↓ 8.3 15,657 1

Nested Loop Left Join (cost=283,996.68..942,626.46 rows=1,894 width=496) (actual time=3,156.272..8,152.313 rows=15,657 loops=1)

  • Buffers: shared hit=109179 read=2165
43. 148.521 7,808.836 ↓ 8.3 15,657 1

Hash Full Join (cost=283,912.18..775,714.13 rows=1,894 width=53) (actual time=3,156.241..7,808.836 rows=15,657 loops=1)

  • Hash Cond: (guiaprestador_1.guiguiaassoc = guiaconvenio_1.id)
  • Buffers: shared hit=56788 read=2165
44. 338.662 6,059.489 ↓ 9.7 13,086 1

Hash Join (cost=145,912.88..636,696.08 rows=1,355 width=30) (actual time=1,555.405..6,059.489 rows=13,086 loops=1)

  • Hash Cond: (guiaconvparaprestador.id = guiaprestador_1.guiguiaassoc)
  • Buffers: shared hit=40315 read=2165
45. 2,253.779 4,459.474 ↑ 1.7 53,110 1

Hash Join (cost=70,279.38..491,973.83 rows=91,451 width=8) (actual time=202.589..4,459.474 rows=53,110 loops=1)

  • Hash Cond: (guiaconvparaprestador.guiprotocolo = protocoloconvparaprestador.id)
  • Buffers: shared hit=25186 read=2165
46. 2,005.065 2,005.065 ↑ 1.0 386,033 1

Seq Scan on fiboguia guiaconvparaprestador (cost=0.00..219,023.50 rows=386,033 width=16) (actual time=0.011..2,005.065 rows=386,033 loops=1)

  • Buffers: shared hit=23842 read=2165
47. 100.051 200.630 ↑ 1.0 19,619 1

Hash (cost=50,660.38..50,660.38 rows=19,619 width=8) (actual time=200.616..200.630 rows=19,619 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1023kB
  • Buffers: shared hit=1344
48. 100.579 100.579 ↑ 1.0 19,619 1

Index Scan using idx_fiboprotocolo_data_pagto_idx on fiboprotocolo protocoloconvparaprestador (cost=58.50..50,660.38 rows=19,619 width=8) (actual time=0.015..100.579 rows=19,619 loops=1)

  • Index Cond: ((data_pagto >= '2018-01-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-01-01 00:00:00'::timestamp without time zone))
  • Buffers: shared hit=1344
49. 310.940 1,261.353 ↓ 7.3 41,666 1

Hash (cost=69,915.49..69,915.49 rows=5,718 width=30) (actual time=1,261.330..1,261.353 rows=41,666 loops=1)

  • Buckets: 65536 (originally 8192) Batches: 1 (originally 1) Memory Usage: 3197kB
  • Buffers: shared hit=15129
50. 620.151 950.413 ↓ 10.6 60,494 1

Nested Loop (cost=200.30..69,915.49 rows=5,718 width=30) (actual time=0.052..950.413 rows=60,494 loops=1)

  • Buffers: shared hit=15129
51. 0.394 0.422 ↑ 1.0 56 1

Bitmap Heap Scan on fibocompetencia competenciaprestador_1 (cost=115.80..190.80 rows=56 width=8) (actual time=0.026..0.422 rows=56 loops=1)

  • Recheck Cond: (comp_convenio = 'Bradesco'::text)
  • Heap Blocks: exact=17
  • Buffers: shared hit=19
52. 0.028 0.028 ↑ 1.0 56 1

Bitmap Index Scan on idx_fibocompetencia_comp_convenio_idx (cost=0.00..113.00 rows=56 width=0) (actual time=0.015..0.028 rows=56 loops=1)

  • Index Cond: (comp_convenio = 'Bradesco'::text)
  • Buffers: shared hit=2
53. 329.840 329.840 ↓ 10.2 1,080 56

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaprestador_1 (cost=84.50..1,192.08 rows=106 width=38) (actual time=0.035..5.890 rows=1,080 loops=56)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 907
  • Buffers: shared hit=15110
54. 82.721 1,600.826 ↓ 8.3 15,657 1

Hash (cost=136,105.30..136,105.30 rows=1,894 width=23) (actual time=1,600.817..1,600.826 rows=15,657 loops=1)

  • Buckets: 16384 (originally 2048) Batches: 1 (originally 1) Memory Usage: 978kB
  • Buffers: shared hit=16473
55. 353.421 1,518.105 ↓ 8.3 15,657 1

Hash Join (cost=70,479.68..136,105.30 rows=1,894 width=23) (actual time=576.379..1,518.105 rows=15,657 loops=1)

  • Hash Cond: (guiaconvenio_1.guiprotocolo = protocoloconvenio_1.id)
  • Buffers: shared hit=16473
56. 539.912 829.885 ↓ 6.4 50,810 1

Nested Loop (cost=200.30..61,627.49 rows=7,997 width=31) (actual time=0.139..829.885 rows=50,810 loops=1)

  • Buffers: shared hit=15129
57. 0.298 0.341 ↑ 1.0 56 1

Bitmap Heap Scan on fibocompetencia competenciaconvenio_1 (cost=115.80..190.80 rows=56 width=8) (actual time=0.033..0.341 rows=56 loops=1)

  • Recheck Cond: (comp_convenio = 'Bradesco'::text)
  • Heap Blocks: exact=17
  • Buffers: shared hit=19
58. 0.043 0.043 ↑ 1.0 56 1

Bitmap Index Scan on idx_fibocompetencia_comp_convenio_idx (cost=0.00..113.00 rows=56 width=0) (actual time=0.015..0.043 rows=56 loops=1)

  • Index Cond: (comp_convenio = 'Bradesco'::text)
  • Buffers: shared hit=2
59. 289.632 289.632 ↓ 6.1 907 56

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaconvenio_1 (cost=84.50..1,023.08 rows=148 width=39) (actual time=0.163..5.172 rows=907 loops=56)

  • Index Cond: (guicompetencia = competenciaconvenio_1.id)
  • Filter: (guiorigem = 'CONVENIO'::text)
  • Rows Removed by Filter: 1080
  • Buffers: shared hit=15110
60. 166.048 334.799 ↑ 1.0 19,619 1

Hash (cost=50,660.38..50,660.38 rows=19,619 width=8) (actual time=334.790..334.799 rows=19,619 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1023kB
  • Buffers: shared hit=1344
61. 168.751 168.751 ↑ 1.0 19,619 1

Index Scan using idx_fiboprotocolo_data_pagto_idx on fiboprotocolo protocoloconvenio_1 (cost=58.50..50,660.38 rows=19,619 width=8) (actual time=0.014..168.751 rows=19,619 loops=1)

  • Index Cond: ((data_pagto >= '2018-01-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-01-01 00:00:00'::timestamp without time zone))
  • Buffers: shared hit=1344
62. 93.942 93.942 ↑ 1.0 1 15,657

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=84.50..88.13 rows=1 width=467) (actual time=0.006..0.006 rows=1 loops=15,657)

  • Index Cond: (COALESCE(guiaprestador_1.id, guiaconvenio_1.guiguiaassoc) = id)
  • Buffers: shared hit=52391
63. 93.942 93.942 ↑ 1.0 1 15,657

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioprestador (cost=83.50..87.10 rows=1 width=74) (actual time=0.006..0.006 rows=1 loops=15,657)

  • Index Cond: (guiaprestador.guibenefic = id)
  • Buffers: shared hit=52376
64. 41.613 83.131 ↑ 1.0 8,350 1

Hash (cost=4,353.00..4,353.00 rows=8,350 width=68) (actual time=83.122..83.131 rows=8,350 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 998kB
  • Buffers: shared hit=178
65. 41.518 41.518 ↑ 1.0 8,350 1

Seq Scan on fiboremessa remessa (cost=0.00..4,353.00 rows=8,350 width=68) (actual time=0.011..41.518 rows=8,350 loops=1)

  • Buffers: shared hit=178
66. 6.376 12.740 ↑ 1.0 1,188 1

Hash (cost=613.00..613.00 rows=1,188 width=26) (actual time=12.731..12.740 rows=1,188 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 84kB
  • Buffers: shared hit=19
67. 6.364 6.364 ↑ 1.0 1,188 1

Seq Scan on fibocompetencia competenciaprestador (cost=0.00..613.00 rows=1,188 width=26) (actual time=0.008..6.364 rows=1,188 loops=1)

  • Buffers: shared hit=19
68. 5.005 10.150 ↑ 1.0 1,022 1

Hash (cost=530.00..530.00 rows=1,022 width=59) (actual time=10.141..10.150 rows=1,022 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 103kB
  • Buffers: shared hit=19
69. 5.145 5.145 ↑ 1.0 1,022 1

Seq Scan on fibodefinicaomotivoglosa motivoglosaprestador (cost=0.00..530.00 rows=1,022 width=59) (actual time=0.013..5.145 rows=1,022 loops=1)

  • Buffers: shared hit=19
70. 0.122 0.250 ↑ 1.0 25 1

Hash (cost=13.50..13.50 rows=25 width=30) (actual time=0.241..0.250 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=1
71. 0.128 0.128 ↑ 1.0 25 1

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

  • Buffers: shared hit=1
72. 0.233 0.445 ↑ 1.0 25 1

Hash (cost=13.50..13.50 rows=25 width=30) (actual time=0.436..0.445 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=1
73. 0.212 0.212 ↑ 1.0 25 1

Seq Scan on fibosituacaoguia situacaoassociacaoprestador (cost=0.00..13.50 rows=25 width=30) (actual time=0.005..0.212 rows=25 loops=1)

  • Buffers: shared hit=1
74. 0.144 0.299 ↑ 1.0 15 1

Hash (cost=8.50..8.50 rows=15 width=25) (actual time=0.290..0.299 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
75. 0.155 0.155 ↑ 1.0 15 1

Seq Scan on fibostatusguia statusprestadorconciliacao (cost=0.00..8.50 rows=15 width=25) (actual time=0.009..0.155 rows=15 loops=1)

  • Buffers: shared hit=1
76. 0.076 0.158 ↑ 1.0 15 1

Hash (cost=8.50..8.50 rows=15 width=25) (actual time=0.149..0.158 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
77. 0.082 0.082 ↑ 1.0 15 1

Seq Scan on fibostatusguia statusprestadoranalise (cost=0.00..8.50 rows=15 width=25) (actual time=0.005..0.082 rows=15 loops=1)

  • Buffers: shared hit=1
78. 17.411 34.920 ↑ 1.0 2,899 1

Hash (cost=1,474.50..1,474.50 rows=2,899 width=33) (actual time=34.911..34.920 rows=2,899 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 221kB
  • Buffers: shared hit=25
79. 17.509 17.509 ↑ 1.0 2,899 1

Seq Scan on fiboprestador prestadororiginalprestador (cost=0.00..1,474.50 rows=2,899 width=33) (actual time=0.007..17.509 rows=2,899 loops=1)

  • Buffers: shared hit=25
80. 0.171 0.349 ↑ 1.0 36 1

Hash (cost=19.00..19.00 rows=36 width=32) (actual time=0.340..0.349 rows=36 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=1
81. 0.178 0.178 ↑ 1.0 36 1

Seq Scan on fibooperadora operadoraoriginalprestador (cost=0.00..19.00 rows=36 width=32) (actual time=0.007..0.178 rows=36 loops=1)

  • Buffers: shared hit=1
82. 5.050 9.918 ↑ 1.0 936 1

Hash (cost=479.00..479.00 rows=936 width=29) (actual time=9.909..9.918 rows=936 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 68kB
  • Buffers: shared hit=11
83. 4.868 4.868 ↑ 1.0 936 1

Seq Scan on quitacao_sistema_gestao (cost=0.00..479.00 rows=936 width=29) (actual time=0.007..4.868 rows=936 loops=1)

  • Buffers: shared hit=11
84. 0.009 0.023 ↓ 0.0 0 1

Hash (cost=110.00..110.00 rows=200 width=96) (actual time=0.014..0.023 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
85. 0.014 0.014 ↓ 0.0 0 1

Seq Scan on detalhes_quitacao_rpa (cost=0.00..110.00 rows=200 width=96) (actual time=0.005..0.014 rows=0 loops=1)

86. 93.942 93.942 ↑ 1.0 1 15,657

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloprestador (cost=58.50..62.10 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=15,657)

  • Index Cond: (guiaprestador.guiprotocolo = id)
  • Buffers: shared hit=39268
87. 0.041 0.060 ↑ 1.0 1 1

Hash (cost=1.50..1.50 rows=1 width=45) (actual time=0.024..0.060 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
88. 0.019 0.019 ↑ 1.0 1 1

Seq Scan on fibohospital hospitalprestador (cost=0.00..1.50 rows=1 width=45) (actual time=0.006..0.019 rows=1 loops=1)

  • Buffers: shared hit=1
89. 0.009 0.023 ↓ 0.0 0 1

Hash (cost=145.00..145.00 rows=270 width=176) (actual time=0.014..0.023 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
90. 0.014 0.014 ↓ 0.0 0 1

Seq Scan on observacao_recurso_guia obs_rec_guia (cost=0.00..145.00 rows=270 width=176) (actual time=0.005..0.014 rows=0 loops=1)

91. 78.285 78.285 ↓ 0.0 0 15,657

Index Scan using fiboguia_pkey on fiboguia guiarecurso (cost=84.50..88.11 rows=1 width=24) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (guiaprestador.guia_recurso_id = id)
  • Buffers: shared hit=11384
92. 78.285 78.285 ↓ 0.0 0 15,657

Index Scan using fiboguia_pkey on fiboguia guiapagamentorecurso (cost=84.50..88.11 rows=1 width=14) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (id = guiarecurso.guiguiaassoc)
  • Buffers: shared hit=8973
93. 93.942 93.942 ↑ 1.0 1 15,657

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=84.50..88.13 rows=1 width=389) (actual time=0.006..0.006 rows=1 loops=15,657)

  • Index Cond: (COALESCE(guiaconvenio_1.id, guiaprestador_1.guiguiaassoc) = id)
  • Buffers: shared hit=62673
94. 93.942 93.942 ↑ 1.0 1 15,657

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=83.50..87.10 rows=1 width=49) (actual time=0.006..0.006 rows=1 loops=15,657)

  • Index Cond: (guiaconvenio.guibenefic = id)
  • Buffers: shared hit=62662
95. 5.722 11.397 ↑ 1.0 1,188 1

Hash (cost=613.00..613.00 rows=1,188 width=26) (actual time=11.388..11.397 rows=1,188 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 84kB
  • Buffers: shared hit=19
96. 5.675 5.675 ↑ 1.0 1,188 1

Seq Scan on fibocompetencia competenciaconvenio (cost=0.00..613.00 rows=1,188 width=26) (actual time=0.007..5.675 rows=1,188 loops=1)

  • Buffers: shared hit=19
97. 4.884 9.800 ↑ 1.0 1,022 1

Hash (cost=530.00..530.00 rows=1,022 width=59) (actual time=9.791..9.800 rows=1,022 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 103kB
  • Buffers: shared hit=19
98. 4.916 4.916 ↑ 1.0 1,022 1

Seq Scan on fibodefinicaomotivoglosa motivoglosaconvenio (cost=0.00..530.00 rows=1,022 width=59) (actual time=0.006..4.916 rows=1,022 loops=1)

  • Buffers: shared hit=19
99. 0.122 0.249 ↑ 1.0 25 1

Hash (cost=13.50..13.50 rows=25 width=30) (actual time=0.240..0.249 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=1
100. 0.127 0.127 ↑ 1.0 25 1

Seq Scan on fibosituacaoguia situacaoconvenio (cost=0.00..13.50 rows=25 width=30) (actual time=0.005..0.127 rows=25 loops=1)

  • Buffers: shared hit=1
101. 0.077 0.159 ↑ 1.0 15 1

Hash (cost=8.50..8.50 rows=15 width=25) (actual time=0.149..0.159 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
102. 0.082 0.082 ↑ 1.0 15 1

Seq Scan on fibostatusguia statusconvenioconciliacao (cost=0.00..8.50 rows=15 width=25) (actual time=0.005..0.082 rows=15 loops=1)

  • Buffers: shared hit=1
103. 0.085 0.184 ↑ 1.0 15 1

Hash (cost=8.50..8.50 rows=15 width=25) (actual time=0.175..0.184 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
104. 0.099 0.099 ↑ 1.0 15 1

Seq Scan on fibostatusguia statusconvenioanalise (cost=0.00..8.50 rows=15 width=25) (actual time=0.005..0.099 rows=15 loops=1)

  • Buffers: shared hit=1
105. 78.285 78.285 ↑ 1.0 1 15,657

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloconvenio (cost=58.50..62.10 rows=1 width=51) (actual time=0.005..0.005 rows=1 loops=15,657)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
  • Buffers: shared hit=47013
106. 0.027 0.054 ↑ 1.0 1 1

Hash (cost=1.50..1.50 rows=1 width=45) (actual time=0.045..0.054 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
107. 0.027 0.027 ↑ 1.0 1 1

Seq Scan on fibohospital hospitalconvenio (cost=0.00..1.50 rows=1 width=45) (actual time=0.009..0.027 rows=1 loops=1)

  • Buffers: shared hit=1
108. 14.329 28.732 ↑ 1.0 2,899 1

Hash (cost=1,474.50..1,474.50 rows=2,899 width=33) (actual time=28.723..28.732 rows=2,899 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 221kB
  • Buffers: shared hit=25
109. 14.403 14.403 ↑ 1.0 2,899 1

Seq Scan on fiboprestador prestadororiginalconvenio (cost=0.00..1,474.50 rows=2,899 width=33) (actual time=0.007..14.403 rows=2,899 loops=1)

  • Buffers: shared hit=25
110. 0.213 0.409 ↑ 1.0 36 1

Hash (cost=19.00..19.00 rows=36 width=32) (actual time=0.400..0.409 rows=36 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=1
111. 0.196 0.196 ↑ 1.0 36 1

Seq Scan on fibooperadora operadoraoriginalconvenio (cost=0.00..19.00 rows=36 width=32) (actual time=0.007..0.196 rows=36 loops=1)

  • Buffers: shared hit=1
112. 9.111 18.248 ↑ 1.0 1,879 1

Hash (cost=993.50..993.50 rows=1,879 width=12) (actual time=18.240..18.248 rows=1,879 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 105kB
  • Buffers: shared hit=54
113. 9.137 9.137 ↑ 1.0 1,879 1

Seq Scan on recebimento (cost=0.00..993.50 rows=1,879 width=12) (actual time=0.007..9.137 rows=1,879 loops=1)

  • Buffers: shared hit=54
114. 78.285 78.285 ↓ 0.0 0 15,657

Index Scan using fiboguia_pkey on fiboguia guiacobrancaoriginal (cost=84.50..88.11 rows=1 width=86) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
  • Buffers: shared hit=5661
115. 40.229 80.677 ↑ 1.0 8,350 1

Hash (cost=4,353.00..4,353.00 rows=8,350 width=41) (actual time=80.668..80.677 rows=8,350 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 743kB
  • Buffers: shared hit=178
116. 40.448 40.448 ↑ 1.0 8,350 1

Seq Scan on fiboremessa remessacobrancaoriginal (cost=0.00..4,353.00 rows=8,350 width=41) (actual time=0.014..40.448 rows=8,350 loops=1)

  • Buffers: shared hit=178
117. 78.285 78.285 ↓ 0.0 0 15,657

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiariocobrancaoriginal (cost=83.50..87.10 rows=1 width=34) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
  • Buffers: shared hit=5664
118. 0.171 0.349 ↑ 1.0 36 1

Hash (cost=19.00..19.00 rows=36 width=32) (actual time=0.340..0.349 rows=36 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=1
119. 0.178 0.178 ↑ 1.0 36 1

Seq Scan on fibooperadora operadoraoriginalcobrancaoriginal (cost=0.00..19.00 rows=36 width=32) (actual time=0.007..0.178 rows=36 loops=1)

  • Buffers: shared hit=1
120. 13.803 27.883 ↑ 1.0 2,910 1

Hash (cost=1,494.00..1,494.00 rows=2,910 width=129) (actual time=27.874..27.883 rows=2,910 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 213kB
  • Buffers: shared hit=39
121. 14.080 14.080 ↑ 1.0 2,910 1

Seq Scan on lote_recurso (cost=0.00..1,494.00 rows=2,910 width=129) (actual time=0.008..14.080 rows=2,910 loops=1)

  • Buffers: shared hit=39
122. 0.009 0.023 ↓ 0.0 0 1

Hash (cost=120.00..120.00 rows=220 width=155) (actual time=0.014..0.023 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
123. 0.014 0.014 ↓ 0.0 0 1

Seq Scan on sincronia_recursos_aceites_erp (cost=0.00..120.00 rows=220 width=155) (actual time=0.005..0.014 rows=0 loops=1)

124. 0.010 0.023 ↓ 0.0 0 1

Hash (cost=170.00..170.00 rows=320 width=48) (actual time=0.013..0.023 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
125. 0.013 0.013 ↓ 0.0 0 1

Seq Scan on pendencia (cost=0.00..170.00 rows=320 width=48) (actual time=0.005..0.013 rows=0 loops=1)

126.          

SubPlan (forHash Left Join)

127. 0.000 0.000 ↓ 0.0 0

Seq Scan on anexo_recurso (cost=0.00..638.50 rows=1 width=0) (never executed)

  • Filter: ((entidade_id = guiaprestador.id) AND (nivel = 'Guia'::text))
128. 1.915 1.915 ↑ 1.0 421 1

Seq Scan on anexo_recurso anexo_recurso_1 (cost=0.00..428.00 rows=421 width=8) (actual time=0.008..1.915 rows=421 loops=1)

  • Filter: (nivel = 'Guia'::text)
  • Buffers: shared hit=7
129. 78.285 78.285 ↓ 0.0 0 15,657

Index Only Scan using idx_fiboguia_id_guia_originaria_idx on fiboguia (cost=84.50..89.00 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
  • Buffers: shared hit=39258
130. 0.000 0.000 ↓ 0.0 0

Seq Scan on fiboguia fiboguia_1 (cost=0.00..219,023.50 rows=386,033 width=8) (never executed)

131. 78.285 78.285 ↓ 0.0 0 15,657

Index Only Scan using idx_fiboguia_id_guia_originaria_idx on fiboguia fiboguia_2 (cost=84.50..89.00 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
  • Buffers: shared hit=46971
132. 0.000 0.000 ↓ 0.0 0

Seq Scan on fiboguia fiboguia_3 (cost=0.00..219,023.50 rows=386,033 width=8) (never executed)

133. 250.512 673.251 ↑ 1.0 1 15,657

Aggregate (cost=258.50..259.50 rows=1 width=32) (actual time=0.038..0.043 rows=1 loops=15,657)

  • Buffers: shared hit=33515
134. 170.577 422.739 ↓ 0.0 0 15,657

Nested Loop Left Join (cost=197.50..208.00 rows=1 width=82) (actual time=0.026..0.027 rows=0 loops=15,657)

  • Buffers: shared hit=33515
135. 170.302 250.512 ↓ 0.0 0 15,657

Nested Loop Left Join (cost=139.50..148.50 rows=1 width=34) (actual time=0.016..0.016 rows=0 loops=15,657)

  • Buffers: shared hit=32690
136. 78.285 78.285 ↓ 0.0 0 15,657

Index Scan using idx_fiboglosasguia_id_guia_idx on fiboglosasguia glosasguia (cost=55.00..59.50 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (id_guia = guiaconvenio.id)
  • Buffers: shared hit=31589
137. 1.925 1.925 ↑ 1.0 1 275

Index Scan using fiboglosa_pkey on fiboglosa glosas (cost=84.50..89.00 rows=1 width=42) (actual time=0.007..0.007 rows=1 loops=275)

  • Index Cond: (id = glosasguia.elt)
  • Buffers: shared hit=1101
138. 1.650 1.650 ↑ 1.0 1 275

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo (cost=58.00..59.50 rows=1 width=64) (actual time=0.006..0.006 rows=1 loops=275)

  • Index Cond: (id = glosas.glo_motivo)
  • Buffers: shared hit=825
139. 250.512 328.797 ↑ 1.0 1 15,657

Aggregate (cost=63.00..63.50 rows=1 width=32) (actual time=0.016..0.021 rows=1 loops=15,657)

  • Buffers: shared hit=31314
140. 78.285 78.285 ↓ 0.0 0 15,657

Index Scan using idx_espelhamento_site_convenio_guia_convenio_id_idx on espelhamento_site_convenio esp (cost=57.50..62.00 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (guia_convenio_id = guiaconvenio.id)
  • Buffers: shared hit=31314
141. 0.000 78.285 ↓ 0.0 0 15,657

Index Scan using fiboguia_pkey on fiboguia fiboguia_5 (cost=173.50..178.00 rows=1 width=6) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (id = $11)
  • Buffers: shared hit=536
142.          

Initplan (forIndex Scan)

143. 93.942 93.942 ↓ 0.0 0 15,657

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia fiboguia_4 (cost=84.50..89.00 rows=1 width=8) (actual time=0.005..0.006 rows=0 loops=15,657)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
  • Buffers: shared hit=9439
144. 250.512 328.797 ↑ 1.0 1 15,657

Aggregate (cost=90.50..91.00 rows=1 width=32) (actual time=0.016..0.021 rows=1 loops=15,657)

  • Buffers: shared hit=39351
145. 78.285 78.285 ↓ 0.0 0 15,657

Index Scan using idx_fiboguia_guicobrancaoriginal_idx on fiboguia pagrecurso (cost=84.50..89.50 rows=1 width=6) (actual time=0.005..0.005 rows=0 loops=15,657)

  • Index Cond: (guicobrancaoriginal = guiaprestador.id)
  • Filter: (guisituacaoguia = 'PosAuditoria'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=39351
146. 0.000 0.000 ↓ 0.0 0

Seq Scan on devolucao_guia devolucao (cost=0.00..5.00 rows=1 width=0) (never executed)

  • Filter: (guiaprestador.id = guia_devolvida_id)
147. 0.033 0.033 ↑ 1.0 4 1

Seq Scan on devolucao_guia devolucao_1 (cost=0.00..3.00 rows=4 width=8) (actual time=0.006..0.033 rows=4 loops=1)

  • Buffers: shared hit=1
Planning time : 32.614 ms
Execution time : 18,635.882 ms