explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RBW4p

Settings
# exclusive inclusive rows x rows loops node
1. 0.041 808.351 ↑ 1.0 100 1

Limit (cost=38,933,675.74..38,933,675.99 rows=100 width=3,065) (actual time=808.296..808.351 rows=100 loops=1)

2. 14.904 808.310 ↑ 3,979.8 100 1

Sort (cost=38,933,675.74..38,934,670.70 rows=397,984 width=3,065) (actual time=808.296..808.310 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. 52.510 793.406 ↑ 79.1 5,033 1

WindowAgg (cost=15,897.19..38,914,485.24 rows=397,984 width=3,065) (actual time=775.816..793.406 rows=5,033 loops=1)

4. 102.366 740.896 ↑ 79.1 5,033 1

Hash Left Join (cost=15,897.19..38,881,651.56 rows=397,984 width=2,663) (actual time=174.034..740.896 rows=5,033 loops=1)

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

Initplan (forHash Left Join)

6. 0.023 0.023 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 4.300 553.676 ↑ 18.5 5,033 1

Hash Left Join (cost=15,746.56..318,466.79 rows=93,314 width=1,983) (actual time=164.064..553.676 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.id = pendencia.guia_id)
8. 7.160 549.371 ↑ 18.5 5,033 1

Hash Left Join (cost=15,729.36..318,099.42 rows=93,314 width=1,943) (actual time=164.044..549.371 rows=5,033 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: 7
9. 3.953 496.445 ↑ 18.5 5,033 1

Hash Left Join (cost=11,902.73..311,706.65 rows=93,314 width=1,908) (actual time=117.903..496.445 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.id_lote_recurso = lote_recurso.id)
10. 4.098 475.432 ↑ 18.5 5,033 1

Hash Left Join (cost=10,305.14..309,703.55 rows=93,314 width=1,838) (actual time=100.656..475.432 rows=5,033 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadoraoriginalcobrancaoriginal.id)
11. 4.834 471.232 ↑ 18.5 5,033 1

Hash Left Join (cost=10,299.78..308,547.87 rows=93,314 width=1,822) (actual time=100.530..471.232 rows=5,033 loops=1)

  • Hash Cond: (operadoraoriginalconvenio.id_multitenant = operadora_multitenant_convenio.id)
12. 5.611 459.530 ↑ 4.3 5,033 1

Nested Loop Left Join (cost=10,153.53..305,089.13 rows=21,879 width=1,766) (actual time=93.643..459.530 rows=5,033 loops=1)

13. 3.881 453.919 ↑ 4.3 5,033 1

Hash Left Join (cost=10,153.10..294,757.93 rows=21,879 width=1,749) (actual time=93.637..453.919 rows=5,033 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guiremessa = remessacobrancaoriginal.id)
14. 5.732 416.292 ↑ 4.3 5,033 1

Nested Loop Left Join (cost=7,600.81..292,005.50 rows=21,879 width=1,726) (actual time=59.809..416.292 rows=5,033 loops=1)

15. 4.889 410.560 ↑ 4.3 5,033 1

Hash Left Join (cost=7,600.38..277,280.84 rows=21,879 width=1,657) (actual time=59.805..410.560 rows=5,033 loops=1)

  • Hash Cond: (guiaconvenio.recebimento_id = recebimento.id)
16. 4.536 404.229 ↑ 4.3 5,033 1

Hash Left Join (cost=7,501.88..277,008.45 rows=21,879 width=1,653) (actual time=58.353..404.229 rows=5,033 loops=1)

  • Hash Cond: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.id)
17. 4.399 399.601 ↑ 4.3 5,033 1

Hash Left Join (cost=7,496.52..276,733.38 rows=21,879 width=1,637) (actual time=58.254..399.601 rows=5,033 loops=1)

  • Hash Cond: (guiaconvenio.guiprestoriginal = prestadororiginalconvenio.id)
18. 4.404 394.456 ↑ 4.3 5,033 1

Hash Left Join (cost=7,448.52..276,574.98 rows=21,879 width=1,604) (actual time=57.499..394.456 rows=5,033 loops=1)

  • Hash Cond: (protocoloconvenio.hospital = hospitalconvenio.id)
19. 5.865 390.044 ↑ 4.3 5,033 1

Nested Loop Left Join (cost=7,447.50..276,273.12 rows=21,879 width=1,540) (actual time=57.482..390.044 rows=5,033 loops=1)

20. 4.130 369.080 ↑ 4.3 5,033 1

Hash Left Join (cost=7,447.08..265,897.09 rows=21,879 width=1,506) (actual time=57.449..369.080 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guistatusanaliseglosa = statusconvenioanalise.stcodigo)
21. 4.607 364.934 ↑ 4.3 5,033 1

Hash Left Join (cost=7,445.74..265,766.08 rows=21,879 width=1,474) (actual time=57.427..364.934 rows=5,033 loops=1)

  • Hash Cond: (guiaconvenio.guistatusconciliacao = statusconvenioconciliacao.stcodigo)
22. 4.497 360.311 ↑ 4.3 5,033 1

Hash Left Join (cost=7,444.40..265,463.90 rows=21,879 width=1,442) (actual time=57.402..360.311 rows=5,033 loops=1)

  • Hash Cond: (guiaconvenio.guisituacaoguia = situacaoconvenio.sitcodigo)
23. 3.047 355.788 ↑ 4.3 5,033 1

Hash Left Join (cost=7,442.84..265,161.50 rows=21,879 width=1,410) (actual time=57.366..355.788 rows=5,033 loops=1)

  • Hash Cond: (guiaconvenio.guimotglosa = motivoglosaconvenio.id)
24. 4.481 351.973 ↑ 4.3 5,033 1

Hash Left Join (cost=7,402.05..265,038.66 rows=21,879 width=1,367) (actual time=56.590..351.973 rows=5,033 loops=1)

  • Hash Cond: (guiaconvenio.guicompetencia = competenciaconvenio.id)
25. 3.036 346.871 ↑ 4.3 5,033 1

Nested Loop Left Join (cost=7,370.98..264,706.75 rows=21,879 width=1,349) (actual time=55.952..346.871 rows=5,033 loops=1)

26. 7.898 293.505 ↑ 4.3 5,033 1

Nested Loop Left Join (cost=7,370.56..254,375.54 rows=21,879 width=1,317) (actual time=55.911..293.505 rows=5,033 loops=1)

27. 4.964 270.508 ↑ 4.3 5,033 1

Nested Loop Left Join (cost=7,370.13..100,977.07 rows=21,879 width=987) (actual time=55.895..270.508 rows=5,033 loops=1)

28. 7.109 265.544 ↑ 4.3 5,033 1

Nested Loop Left Join (cost=7,369.70..86,252.41 rows=21,879 width=989) (actual time=55.887..265.544 rows=5,033 loops=1)

29. 3.671 248.369 ↑ 4.3 5,033 1

Hash Left Join (cost=7,369.27..71,527.76 rows=21,879 width=965) (actual time=55.561..248.369 rows=5,033 loops=1)

  • Hash Cond: (protocoloprestador.hospital = hospitalprestador.id)
30. 5.261 244.687 ↑ 4.3 5,033 1

Nested Loop Left Join (cost=7,368.25..71,225.90 rows=21,879 width=901) (actual time=55.534..244.687 rows=5,033 loops=1)

31. 3.694 224.327 ↑ 4.3 5,033 1

Hash Left Join (cost=7,367.83..60,849.87 rows=21,879 width=901) (actual time=55.470..224.327 rows=5,033 loops=1)

  • Hash Cond: (operadoraoriginalprestador.id_multitenant = operadora_multitenant_prestador.id)
32. 3.531 213.769 ↑ 1.0 5,033 1

Hash Left Join (cost=7,221.58..59,926.94 rows=5,130 width=845) (actual time=48.596..213.769 rows=5,033 loops=1)

  • Hash Cond: ((competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio) AND (remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa))
33. 2.397 207.537 ↑ 1.0 5,033 1

Nested Loop Left Join (cost=6,567.63..59,234.40 rows=5,130 width=834) (actual time=45.884..207.537 rows=5,033 loops=1)

34. 3.782 200.107 ↑ 1.0 5,033 1

Hash Left Join (cost=6,567.21..56,904.48 rows=5,130 width=812) (actual time=45.881..200.107 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guioperadoraoriginal = operadoraoriginalprestador.id)
35. 2.674 196.285 ↑ 1.0 5,033 1

Hash Left Join (cost=6,561.84..56,835.88 rows=5,130 width=796) (actual time=45.836..196.285 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guiprestoriginal = prestadororiginalprestador.id)
36. 2.719 193.323 ↑ 1.0 5,033 1

Hash Left Join (cost=6,513.85..56,762.00 rows=5,130 width=763) (actual time=45.543..193.323 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
37. 3.930 190.598 ↑ 1.0 5,033 1

Hash Left Join (cost=6,512.51..56,730.25 rows=5,130 width=731) (actual time=45.532..190.598 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
38. 3.575 186.659 ↑ 1.0 5,033 1

Hash Left Join (cost=6,511.17..56,658.38 rows=5,130 width=699) (actual time=45.518..186.659 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
39. 3.940 183.074 ↑ 1.0 5,033 1

Hash Left Join (cost=6,509.61..56,586.28 rows=5,130 width=667) (actual time=45.503..183.074 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
40. 2.707 179.120 ↑ 1.0 5,033 1

Hash Left Join (cost=6,508.05..56,514.18 rows=5,130 width=635) (actual time=45.481..179.120 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guimotglosa = motivoglosaprestador.id)
41. 3.749 176.129 ↑ 1.0 5,033 1

Hash Left Join (cost=6,467.25..56,454.14 rows=5,130 width=592) (actual time=45.194..176.129 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador.guicompetencia = competenciaprestador.id)
42. 8.184 172.146 ↑ 1.0 5,033 1

Nested Loop Left Join (cost=6,436.19..56,352.53 rows=5,130 width=574) (actual time=44.949..172.146 rows=5,033 loops=1)

43. 4.784 153.896 ↑ 1.0 5,033 1

Nested Loop Left Join (cost=6,435.90..54,700.73 rows=5,130 width=524) (actual time=44.741..153.896 rows=5,033 loops=1)

44. 7.968 83.683 ↑ 1.0 5,033 1

Nested Loop Left Join (cost=6,435.47..52,278.36 rows=5,130 width=471) (actual time=44.192..83.683 rows=5,033 loops=1)

45. 4.292 60.616 ↑ 1.0 5,033 1

Hash Full Join (cost=6,435.05..16,310.80 rows=5,130 width=53) (actual time=44.182..60.616 rows=5,033 loops=1)

  • Hash Cond: (guiaprestador_1.guiguiaassoc = guiaconvenio_1.id)
46. 2.584 12.174 ↑ 1.0 5,033 1

Nested Loop (cost=0.70..9,857.21 rows=5,130 width=30) (actual time=0.025..12.174 rows=5,033 loops=1)

47. 0.008 0.008 ↑ 1.0 1 1

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaprestador_1 (cost=0.28..8.29 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (id = '289603584'::bigint)
  • Filter: (comp_convenio = 'SulAmerica'::text)
48. 9.582 9.582 ↑ 1.0 5,033 1

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaprestador_1 (cost=0.43..9,797.62 rows=5,130 width=38) (actual time=0.017..9.582 rows=5,033 loops=1)

  • Index Cond: (guicompetencia = '289603584'::bigint)
  • Filter: ((discriminador <> 'RECURSO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 6020
49. 0.779 44.150 ↓ 49.8 5,031 1

Hash (cost=6,433.08..6,433.08 rows=101 width=23) (actual time=44.150..44.150 rows=5,031 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 341kB
50. 1.351 43.371 ↓ 49.8 5,031 1

Nested Loop (cost=221.87..6,433.08 rows=101 width=23) (actual time=33.341..43.371 rows=5,031 loops=1)

51. 0.344 0.344 ↑ 1.0 23 1

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

  • Filter: (comp_convenio = 'SulAmerica'::text)
  • Rows Removed by Filter: 780
52. 5.359 41.676 ↓ 43.8 219 23

Bitmap Heap Scan on fiboguia guiaconvenio_1 (cost=221.60..277.26 rows=5 width=31) (actual time=1.691..1.812 rows=219 loops=23)

  • Recheck Cond: ((guicompetencia = competenciaconvenio_1.id) AND (guicompetenciaassoc = '289603584'::bigint))
  • Filter: ((guiassociada IS TRUE) AND (guisituacaoguia <> ALL ('{PagamentoDeRecurso,PagamentoDeRecursoAntigo}'::text[])) AND (guiorigem = 'CONVENIO'::text))
  • Rows Removed by Filter: 224
  • Heap Blocks: exact=1448
53. 2.392 36.317 ↓ 0.0 0 23

BitmapAnd (cost=221.60..221.60 rows=14 width=0) (actual time=1.579..1.579 rows=0 loops=23)

54. 18.101 18.101 ↓ 5.8 10,233 23

Bitmap Index Scan on idx_fiboguia_guicompetencia_idx (cost=0.00..33.48 rows=1,763 width=0) (actual time=0.787..0.787 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaconvenio_1.id)
55. 15.824 15.824 ↓ 1.0 10,178 23

Bitmap Index Scan on idx_fiboguia_guicompetenciaassoc_idx (cost=0.00..186.99 rows=9,942 width=0) (actual time=0.688..0.688 rows=10,178 loops=23)

  • Index Cond: (guicompetenciaassoc = '289603584'::bigint)
56. 15.099 15.099 ↑ 1.0 1 5,033

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=0.43..7.00 rows=1 width=434) (actual time=0.003..0.003 rows=1 loops=5,033)

  • Index Cond: (COALESCE(guiaprestador_1.id, guiaconvenio_1.guiguiaassoc) = id)
57. 65.429 65.429 ↑ 1.0 1 5,033

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

  • Index Cond: (guiaprestador.guibenefic = id)
58. 10.066 10.066 ↑ 1.0 1 5,033

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=5,033)

  • Index Cond: (guiaprestador.guiremessa = id)
59. 0.126 0.234 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 54kB
60. 0.108 0.108 ↑ 1.0 803 1

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

61. 0.148 0.284 ↑ 1.0 1,013 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 102kB
62. 0.136 0.136 ↑ 1.0 1,013 1

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

63. 0.008 0.014 ↑ 1.0 25 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
64. 0.006 0.006 ↑ 1.0 25 1

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

65. 0.004 0.010 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=64) (actual time=0.010..0.010 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
66. 0.006 0.006 ↑ 1.0 25 1

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

67. 0.002 0.009 ↑ 1.0 15 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
68. 0.007 0.007 ↑ 1.0 15 1

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

69. 0.003 0.006 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=64) (actual time=0.006..0.006 rows=15 loops=1)

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

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

71. 0.163 0.288 ↑ 1.0 1,511 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 125kB
72. 0.125 0.125 ↑ 1.0 1,511 1

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

73. 0.016 0.040 ↑ 1.0 104 1

Hash (cost=4.05..4.05 rows=105 width=24) (actual time=0.040..0.040 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
74. 0.024 0.024 ↑ 1.0 104 1

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

75. 5.033 5.033 ↓ 0.0 0 5,033

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=5,033)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
76. 0.854 2.701 ↑ 1.0 4,318 1

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

  • Buckets: 8192 Batches: 1 Memory Usage: 299kB
77. 1.847 1.847 ↑ 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.847 rows=4,318 loops=1)

78. 0.017 6.864 ↑ 8.1 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
79. 6.847 6.847 ↑ 8.1 105 1

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

80. 15.099 15.099 ↑ 1.0 1 5,033

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

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

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

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

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

83. 10.066 10.066 ↓ 0.0 0 5,033

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=5,033)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
84. 0.000 0.000 ↓ 0.0 0 5,033

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=5,033)

  • Index Cond: (id = guiarecurso.guiguiaassoc)
85. 15.099 15.099 ↑ 1.0 1 5,033

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..7.00 rows=1 width=346) (actual time=0.003..0.003 rows=1 loops=5,033)

  • Index Cond: (COALESCE(guiaconvenio_1.id, guiaprestador_1.guiguiaassoc) = id)
86. 50.330 50.330 ↑ 1.0 1 5,033

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=5,033)

  • Index Cond: (guiaconvenio.guibenefic = id)
87. 0.327 0.621 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 54kB
88. 0.294 0.294 ↑ 1.0 803 1

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

89. 0.413 0.768 ↑ 1.0 1,013 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 102kB
90. 0.355 0.355 ↑ 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.355 rows=1,013 loops=1)

91. 0.015 0.026 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=64) (actual time=0.026..0.026 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
92. 0.011 0.011 ↑ 1.0 25 1

Seq Scan on fibosituacaoguia situacaoconvenio (cost=0.00..1.25 rows=25 width=64) (actual time=0.006..0.011 rows=25 loops=1)

93. 0.007 0.016 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=64) (actual time=0.016..0.016 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
94. 0.009 0.009 ↑ 1.0 15 1

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

95. 0.007 0.016 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=64) (actual time=0.016..0.016 rows=15 loops=1)

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

Seq Scan on fibostatusguia statusconvenioanalise (cost=0.00..1.15 rows=15 width=64) (actual time=0.003..0.009 rows=15 loops=1)

97. 15.099 15.099 ↑ 1.0 1 5,033

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloconvenio (cost=0.42..0.46 rows=1 width=50) (actual time=0.003..0.003 rows=1 loops=5,033)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
98. 0.003 0.008 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=72) (actual time=0.008..0.008 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
99. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on fibohospital hospitalconvenio (cost=0.00..1.01 rows=1 width=72) (actual time=0.004..0.005 rows=1 loops=1)

100. 0.436 0.746 ↑ 1.0 1,511 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 125kB
101. 0.310 0.310 ↑ 1.0 1,511 1

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

102. 0.040 0.092 ↑ 1.0 104 1

Hash (cost=4.05..4.05 rows=105 width=24) (actual time=0.092..0.092 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
103. 0.052 0.052 ↑ 1.0 104 1

Seq Scan on fibooperadora operadoraoriginalconvenio (cost=0.00..4.05 rows=105 width=24) (actual time=0.006..0.052 rows=104 loops=1)

104. 0.631 1.442 ↑ 1.0 1,889 1

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

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

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

106. 0.000 0.000 ↓ 0.0 0 5,033

Index Scan using fiboguia_pkey on fiboguia guiacobrancaoriginal (cost=0.43..0.66 rows=1 width=77) (actual time=0.000..0.000 rows=0 loops=5,033)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
107. 14.208 33.746 ↑ 1.0 57,213 1

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

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

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

109. 0.000 0.000 ↓ 0.0 0 5,033

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=5,033)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
110. 0.074 6.868 ↑ 8.1 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
111. 6.794 6.794 ↑ 8.1 105 1

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

112. 0.046 0.102 ↑ 1.0 104 1

Hash (cost=4.05..4.05 rows=105 width=24) (actual time=0.102..0.102 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
113. 0.056 0.056 ↑ 1.0 104 1

Seq Scan on fibooperadora operadoraoriginalcobrancaoriginal (cost=0.00..4.05 rows=105 width=24) (actual time=0.011..0.056 rows=104 loops=1)

114. 7.660 17.060 ↑ 1.0 21,004 1

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

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

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

116. 23.716 45.766 ↑ 1.0 87,465 1

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

  • Buckets: 131072 Batches: 1 Memory Usage: 8717kB
117. 22.050 22.050 ↑ 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.008..22.050 rows=87,465 loops=1)

118. 0.000 0.005 ↓ 0.0 0 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
119. 0.005 0.005 ↓ 0.0 0 1

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

120. 0.025 9.197 ↑ 8.1 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
121. 9.172 9.172 ↑ 8.1 105 1

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

122.          

SubPlan (forHash Left Join)

123. 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))
124. 0.136 0.136 ↑ 1.0 565 1

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

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
125. 10.066 10.066 ↓ 0.0 0 5,033

Index Only Scan using idx_fiboguia_id_guia_originaria_idx on fiboguia (cost=0.43..8.45 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=5,033)

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
126. 5.033 5.033 ↓ 0.0 0 5,033

Index Only Scan using idx_fiboguia_id_guia_originaria_idx on fiboguia fiboguia_1 (cost=0.43..8.45 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=5,033)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
127. 10.066 35.231 ↑ 1.0 1 5,033

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

128. 4.193 25.165 ↓ 0.0 0 5,033

Nested Loop Left Join (cost=1.00..17.08 rows=1 width=89) (actual time=0.005..0.005 rows=0 loops=5,033)

129. 0.000 20.132 ↓ 0.0 0 5,033

Nested Loop Left Join (cost=0.71..16.76 rows=1 width=37) (actual time=0.004..0.004 rows=0 loops=5,033)

130. 10.066 10.066 ↓ 0.0 0 5,033

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=5,033)

  • Index Cond: (id_guia = guiaconvenio.id)
131. 11.280 11.280 ↑ 1.0 1 60

Index Scan using fiboglosa_pkey on fiboglosa glosas (cost=0.43..8.45 rows=1 width=45) (actual time=0.188..0.188 rows=1 loops=60)

  • Index Cond: (id = glosasguia.elt)
132. 0.840 0.840 ↑ 1.0 1 60

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

  • Index Cond: (id = glosas.glo_motivo)
133. 0.000 10.066 ↑ 1.0 1 5,033

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

134. 10.066 10.066 ↓ 0.0 0 5,033

Index Scan using idx_espelhamento_site_convenio_guia_convenio_id_idx on espelhamento_site_convenio esp (cost=0.42..8.44 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=5,033)

  • Index Cond: (guia_convenio_id = guiaconvenio.id)
135. 0.000 0.000 ↓ 0.0 0 5,033

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=5,033)

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

Initplan (forIndex Scan)

137. 0.000 0.000 ↓ 0.0 0 5,033

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=5,033)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
138. 5.033 15.099 ↑ 1.0 1 5,033

Aggregate (cost=12.41..12.42 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=5,033)

139. 10.066 10.066 ↓ 0.0 0 5,033

Index Scan using idx_fiboguia_guicobrancaoriginal_idx on fiboguia pagrecurso (cost=0.43..12.40 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=5,033)

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

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

Planning time : 27.998 ms
Execution time : 1,087.687 ms