explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rCKu

Settings
# exclusive inclusive rows x rows loops node
1. 0.054 2,288.929 ↑ 1.0 100 1

Limit (cost=5,094,058.61..5,094,058.86 rows=100 width=3,065) (actual time=2,288.853..2,288.929 rows=100 loops=1)

2. 23.071 2,288.875 ↑ 512.1 100 1

Sort (cost=5,094,058.61..5,094,186.62 rows=51,206 width=3,065) (actual time=2,288.851..2,288.875 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. 76.181 2,265.804 ↑ 5.9 8,642 1

WindowAgg (cost=47,772.37..5,091,589.49 rows=51,206 width=3,065) (actual time=2,237.846..2,265.804 rows=8,642 loops=1)

4. 141.565 2,189.623 ↑ 5.9 8,642 1

Hash Left Join (cost=47,772.37..5,087,365.00 rows=51,206 width=2,663) (actual time=742.265..2,189.623 rows=8,642 loops=1)

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

Initplan (for Hash Left Join)

6. 0.025 0.025 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 6.304 1,954.156 ↑ 1.4 8,642 1

Hash Left Join (cost=47,621.73..125,560.82 rows=12,006 width=1,983) (actual time=734.183..1,954.156 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.id = pendencia.guia_id)
8. 12.288 1,947.849 ↑ 1.4 8,642 1

Nested Loop Left Join (cost=47,604.53..125,498.57 rows=12,006 width=1,943) (actual time=734.160..1,947.849 rows=8,642 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: 11
9. 5.739 1,892.351 ↑ 1.4 8,642 1

Hash Left Join (cost=47,604.24..121,465.41 rows=12,006 width=1,908) (actual time=734.113..1,892.351 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.id_lote_recurso = lote_recurso.id)
10. 5.882 1,871.790 ↑ 1.4 8,642 1

Hash Left Join (cost=46,006.65..119,815.65 rows=12,006 width=1,838) (actual time=719.064..1,871.790 rows=8,642 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadoraoriginalcobrancaoriginal.id)
11. 6.573 1,865.785 ↑ 1.4 8,642 1

Hash Left Join (cost=46,001.29..119,662.29 rows=12,006 width=1,822) (actual time=718.908..1,865.785 rows=8,642 loops=1)

  • Hash Cond: (operadoraoriginalconvenio.id_multitenant = operadora_multitenant_convenio.id)
12. 7.970 1,849.259 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,855.03..119,089.84 rows=2,815 width=1,766) (actual time=708.925..1,849.259 rows=8,642 loops=1)

13. 7.661 1,841.289 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,854.61..117,760.61 rows=2,815 width=1,749) (actual time=708.921..1,841.289 rows=8,642 loops=1)

14. 7.722 1,833.628 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,854.32..116,854.21 rows=2,815 width=1,726) (actual time=708.917..1,833.628 rows=8,642 loops=1)

15. 6.856 1,825.906 ↓ 3.1 8,642 1

Hash Left Join (cost=45,853.89..114,959.70 rows=2,815 width=1,657) (actual time=708.910..1,825.906 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio.recebimento_id = recebimento.id)
16. 6.610 1,817.510 ↓ 3.1 8,642 1

Hash Left Join (cost=45,755.39..114,838.83 rows=2,815 width=1,653) (actual time=707.347..1,817.510 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.id)
17. 5.588 1,810.797 ↓ 3.1 8,642 1

Hash Left Join (cost=45,750.03..114,798.76 rows=2,815 width=1,637) (actual time=707.225..1,810.797 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio.guiprestoriginal = prestadororiginalconvenio.id)
18. 6.497 1,804.348 ↓ 3.1 8,642 1

Hash Left Join (cost=45,702.03..114,736.55 rows=2,815 width=1,604) (actual time=706.334..1,804.348 rows=8,642 loops=1)

  • Hash Cond: (protocoloconvenio.hospital = hospitalconvenio.id)
19. 9.494 1,797.837 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,701.01..114,696.82 rows=2,815 width=1,540) (actual time=706.301..1,797.837 rows=8,642 loops=1)

20. 5.274 1,771.059 ↓ 3.1 8,642 1

Hash Left Join (cost=45,700.59..113,361.82 rows=2,815 width=1,506) (actual time=706.284..1,771.059 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guistatusanaliseglosa = statusconvenioanalise.stcodigo)
21. 6.683 1,765.763 ↓ 3.1 8,642 1

Hash Left Join (cost=45,699.25..113,343.80 rows=2,815 width=1,474) (actual time=706.243..1,765.763 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio.guistatusconciliacao = statusconvenioconciliacao.stcodigo)
22. 6.674 1,759.057 ↓ 3.1 8,642 1

Hash Left Join (cost=45,697.91..113,303.75 rows=2,815 width=1,442) (actual time=706.175..1,759.057 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio.guisituacaoguia = situacaoconvenio.sitcodigo)
23. 4.816 1,752.348 ↓ 3.1 8,642 1

Hash Left Join (cost=45,696.35..113,263.49 rows=2,815 width=1,410) (actual time=706.107..1,752.348 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio.guimotglosa = motivoglosaconvenio.id)
24. 6.889 1,746.596 ↓ 3.1 8,642 1

Hash Left Join (cost=45,655.56..113,212.13 rows=2,815 width=1,367) (actual time=705.149..1,746.596 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio.guicompetencia = competenciaconvenio.id)
25. 6.425 1,739.029 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,624.49..113,142.35 rows=2,815 width=1,349) (actual time=704.442..1,739.029 rows=8,642 loops=1)

26. 12.012 1,672.110 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,624.07..111,813.12 rows=2,815 width=1,317) (actual time=704.428..1,672.110 rows=8,642 loops=1)

27. 6.688 1,642.814 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,623.64..108,425.68 rows=2,815 width=987) (actual time=704.409..1,642.814 rows=8,642 loops=1)

28. 7.230 1,636.126 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,623.21..106,531.17 rows=2,815 width=989) (actual time=704.403..1,636.126 rows=8,642 loops=1)

29. 5.606 1,611.612 ↓ 3.1 8,642 1

Hash Left Join (cost=45,622.78..104,636.67 rows=2,815 width=965) (actual time=704.058..1,611.612 rows=8,642 loops=1)

  • Hash Cond: (protocoloprestador.hospital = hospitalprestador.id)
30. 9.844 1,605.990 ↓ 3.1 8,642 1

Nested Loop Left Join (cost=45,621.76..104,596.94 rows=2,815 width=901) (actual time=704.019..1,605.990 rows=8,642 loops=1)

31. 5.596 1,578.862 ↓ 3.1 8,642 1

Hash Left Join (cost=45,621.34..103,261.94 rows=2,815 width=901) (actual time=703.995..1,578.862 rows=8,642 loops=1)

  • Hash Cond: (operadoraoriginalprestador.id_multitenant = operadora_multitenant_prestador.id)
32. 8.222 1,526.088 ↓ 13.1 8,642 1

Nested Loop Left Join (cost=45,475.09..103,015.76 rows=660 width=845) (actual time=656.801..1,526.088 rows=8,642 loops=1)

  • Join Filter: (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio)
33. 5.806 1,483.298 ↓ 13.1 8,642 1

Nested Loop Left Join (cost=45,474.80..102,783.67 rows=660 width=834) (actual time=656.782..1,483.298 rows=8,642 loops=1)

34. 5.641 1,468.850 ↓ 13.1 8,642 1

Hash Left Join (cost=45,474.38..102,483.91 rows=660 width=812) (actual time=656.778..1,468.850 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guioperadoraoriginal = operadoraoriginalprestador.id)
35. 4.185 1,463.166 ↓ 13.1 8,642 1

Hash Left Join (cost=45,469.02..102,470.42 rows=660 width=796) (actual time=656.725..1,463.166 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guiprestoriginal = prestadororiginalprestador.id)
36. 4.297 1,458.641 ↓ 13.1 8,642 1

Hash Left Join (cost=45,421.02..102,419.08 rows=660 width=763) (actual time=656.373..1,458.641 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
37. 5.508 1,454.335 ↓ 13.1 8,642 1

Hash Left Join (cost=45,419.69..102,413.83 rows=660 width=731) (actual time=656.356..1,454.335 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
38. 4.990 1,448.816 ↓ 13.1 8,642 1

Hash Left Join (cost=45,418.35..102,403.42 rows=660 width=699) (actual time=656.335..1,448.816 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
39. 5.229 1,443.815 ↓ 13.1 8,642 1

Hash Left Join (cost=45,416.79..102,392.78 rows=660 width=667) (actual time=656.308..1,443.815 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
40. 3.739 1,438.572 ↓ 13.1 8,642 1

Hash Left Join (cost=45,415.22..102,382.14 rows=660 width=635) (actual time=656.282..1,438.572 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guimotglosa = motivoglosaprestador.id)
41. 5.096 1,434.489 ↓ 13.1 8,642 1

Hash Left Join (cost=45,374.43..102,338.87 rows=660 width=592) (actual time=655.927..1,434.489 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador.guicompetencia = competenciaprestador.id)
42. 6.847 1,429.123 ↓ 13.1 8,642 1

Nested Loop Left Join (cost=45,343.36..102,298.72 rows=660 width=574) (actual time=655.631..1,429.123 rows=8,642 loops=1)

43. 8.591 1,404.992 ↓ 13.1 8,642 1

Nested Loop Left Join (cost=45,343.07..102,086.21 rows=660 width=524) (actual time=655.619..1,404.992 rows=8,642 loops=1)

44. 12.206 1,344.549 ↓ 13.1 8,642 1

Nested Loop Left Join (cost=45,342.65..101,774.56 rows=660 width=471) (actual time=655.393..1,344.549 rows=8,642 loops=1)

45. 6.352 1,315.059 ↓ 13.1 8,642 1

Hash Full Join (cost=45,342.22..100,980.35 rows=660 width=53) (actual time=655.385..1,315.059 rows=8,642 loops=1)

  • Hash Cond: (guiaprestador_1.guiguiaassoc = guiaconvenio_1.id)
46. 0.000 1,136.332 ↓ 20.6 8,620 1

Nested Loop (cost=1.55..55,638.10 rows=418 width=30) (actual time=482.993..1,136.332 rows=8,620 loops=1)

47. 25.839 539.822 ↓ 11.5 121,479 1

Nested Loop (cost=1.13..50,509.93 rows=10,590 width=38) (actual time=0.069..539.822 rows=121,479 loops=1)

48. 50.181 202.319 ↓ 14.7 155,832 1

Nested Loop (cost=0.70..37,766.43 rows=10,590 width=30) (actual time=0.029..202.319 rows=155,832 loops=1)

49. 0.384 0.384 ↑ 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.012..0.384 rows=23 loops=1)

  • Filter: (comp_convenio = 'Bradesco'::text)
  • Rows Removed by Filter: 780
50. 151.754 151.754 ↓ 13.2 6,775 23

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaprestador_1 (cost=0.43..1,634.50 rows=513 width=38) (actual time=0.066..6.598 rows=6,775 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 5880
51. 311.664 311.664 ↑ 1.0 1 155,832

Index Scan using fiboguia_pkey on fiboguia guiaconvparaprestador (cost=0.43..1.19 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=155,832)

  • Index Cond: (id = guiaprestador_1.guiguiaassoc)
52. 607.395 607.395 ↓ 0.0 0 121,479

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloconvparaprestador (cost=0.42..0.47 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=121,479)

  • Index Cond: (id = guiaconvparaprestador.guiprotocolo)
  • Filter: ((data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone) AND (data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 1
53. 1.632 172.375 ↓ 13.1 8,642 1

Hash (cost=45,332.42..45,332.42 rows=660 width=23) (actual time=172.375..172.375 rows=8,642 loops=1)

  • Buckets: 16384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 603kB
54. 18.173 170.743 ↓ 13.1 8,642 1

Hash Join (cost=7,530.18..45,332.42 rows=660 width=23) (actual time=150.108..170.743 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio_1.guiprotocolo = protocoloconvenio_1.id)
55. 45.369 142.937 ↓ 8.1 135,242 1

Nested Loop (cost=0.70..37,733.60 rows=16,732 width=31) (actual time=0.042..142.937 rows=135,242 loops=1)

56. 0.347 0.347 ↑ 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.020..0.347 rows=23 loops=1)

  • Filter: (comp_convenio = 'Bradesco'::text)
  • Rows Removed by Filter: 780
57. 97.221 97.221 ↓ 7.3 5,880 23

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaconvenio_1 (cost=0.43..1,630.10 rows=811 width=39) (actual time=0.345..4.227 rows=5,880 loops=23)

  • Index Cond: (guicompetencia = competenciaconvenio_1.id)
  • Filter: (guiorigem = 'CONVENIO'::text)
  • Rows Removed by Filter: 6775
58. 3.582 9.633 ↑ 1.0 15,228 1

Hash (cost=7,338.10..7,338.10 rows=15,310 width=8) (actual time=9.632..9.633 rows=15,228 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 723kB
59. 4.279 6.051 ↑ 1.0 15,228 1

Bitmap Heap Scan on fiboprotocolo protocoloconvenio_1 (cost=405.90..7,338.10 rows=15,310 width=8) (actual time=1.850..6.051 rows=15,228 loops=1)

  • Recheck Cond: ((data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone) AND (data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone))
  • Heap Blocks: exact=377
60. 1.772 1.772 ↑ 1.0 15,228 1

Bitmap Index Scan on idx_fiboprotocolo_data_pagto_idx (cost=0.00..402.07 rows=15,310 width=0) (actual time=1.772..1.772 rows=15,228 loops=1)

  • Index Cond: ((data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone) AND (data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone))
61. 17.284 17.284 ↑ 1.0 1 8,642

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=0.43..1.19 rows=1 width=434) (actual time=0.002..0.002 rows=1 loops=8,642)

  • Index Cond: (COALESCE(guiaprestador_1.id, guiaconvenio_1.guiguiaassoc) = id)
62. 51.852 51.852 ↑ 1.0 1 8,642

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

  • Index Cond: (guiaprestador.guibenefic = id)
63. 17.284 17.284 ↑ 1.0 1 8,642

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=8,642)

  • Index Cond: (guiaprestador.guiremessa = id)
64. 0.138 0.270 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 54kB
65. 0.132 0.132 ↑ 1.0 803 1

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

66. 0.200 0.344 ↑ 1.0 1,013 1

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

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

68. 0.006 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
69. 0.008 0.008 ↑ 1.0 25 1

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

70. 0.006 0.011 ↑ 1.0 25 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
71. 0.005 0.005 ↑ 1.0 25 1

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

72. 0.007 0.011 ↑ 1.0 15 1

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

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

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

74. 0.006 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
75. 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.002..0.003 rows=15 loops=1)

76. 0.198 0.340 ↑ 1.0 1,511 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 125kB
77. 0.142 0.142 ↑ 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.142 rows=1,511 loops=1)

78. 0.021 0.043 ↑ 1.0 104 1

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

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

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

80. 8.642 8.642 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
81. 34.568 34.568 ↑ 1.0 1 8,642

Index Scan using idx_detalhes_quitacao_rpa_numero_remessa_idx on detalhes_quitacao_rpa (cost=0.28..0.34 rows=1 width=26) (actual time=0.004..0.004 rows=1 loops=8,642)

  • Index Cond: (remessa.rem_numero = numero_remessa)
82. 0.074 47.178 ↑ 8.1 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
83. 47.104 47.104 ↑ 8.1 105 1

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

84. 17.284 17.284 ↑ 1.0 1 8,642

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

  • Index Cond: (guiaprestador.guiprotocolo = id)
85. 0.005 0.016 ↑ 1.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
86. 0.011 0.011 ↑ 1.0 1 1

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

87. 17.284 17.284 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
88. 0.000 0.000 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (id = guiarecurso.guiguiaassoc)
89. 17.284 17.284 ↑ 1.0 1 8,642

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..1.19 rows=1 width=346) (actual time=0.002..0.002 rows=1 loops=8,642)

  • Index Cond: (COALESCE(guiaconvenio_1.id, guiaprestador_1.guiguiaassoc) = id)
90. 60.494 60.494 ↑ 1.0 1 8,642

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=48) (actual time=0.007..0.007 rows=1 loops=8,642)

  • Index Cond: (guiaconvenio.guibenefic = id)
91. 0.372 0.678 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 54kB
92. 0.306 0.306 ↑ 1.0 803 1

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

93. 0.546 0.936 ↑ 1.0 1,013 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 102kB
94. 0.390 0.390 ↑ 1.0 1,013 1

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

95. 0.021 0.035 ↑ 1.0 25 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
96. 0.014 0.014 ↑ 1.0 25 1

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

97. 0.013 0.023 ↑ 1.0 15 1

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

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

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

99. 0.016 0.022 ↑ 1.0 15 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
100. 0.006 0.006 ↑ 1.0 15 1

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

101. 17.284 17.284 ↑ 1.0 1 8,642

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=8,642)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
102. 0.009 0.014 ↑ 1.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
103. 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)

104. 0.541 0.861 ↑ 1.0 1,511 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 125kB
105. 0.320 0.320 ↑ 1.0 1,511 1

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

106. 0.053 0.103 ↑ 1.0 104 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
107. 0.050 0.050 ↑ 1.0 104 1

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

108. 0.710 1.540 ↑ 1.0 1,889 1

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

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

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

110. 0.000 0.000 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
111. 0.000 0.000 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (guiacobrancaoriginal.guiremessa = id)
112. 0.000 0.000 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
113. 0.062 9.953 ↑ 8.1 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
114. 9.891 9.891 ↑ 8.1 105 1

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

115. 0.060 0.123 ↑ 1.0 104 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
116. 0.063 0.063 ↑ 1.0 104 1

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

117. 6.677 14.822 ↑ 1.0 21,004 1

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

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

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

119. 43.210 43.210 ↓ 0.0 0 8,642

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.005..0.005 rows=0 loops=8,642)

  • 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
120. 0.000 0.003 ↓ 0.0 0 1

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

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

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

122. 0.052 7.153 ↑ 8.1 105 1

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

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

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

124.          

SubPlan (for Hash 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.300 0.300 ↑ 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.300 rows=565 loops=1)

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
127. 17.284 17.284 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
128. 8.642 8.642 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
129. 8.642 25.926 ↑ 1.0 1 8,642

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

130. 0.000 17.284 ↓ 0.0 0 8,642

Nested Loop Left Join (cost=1.00..17.08 rows=1 width=89) (actual time=0.002..0.002 rows=0 loops=8,642)

131. 8.410 17.284 ↓ 0.0 0 8,642

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

132. 8.642 8.642 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (id_guia = guiaconvenio.id)
133. 0.232 0.232 ↑ 1.0 1 58

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

  • Index Cond: (id = glosasguia.elt)
134. 0.174 0.174 ↑ 1.0 1 58

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

  • Index Cond: (id = glosas.glo_motivo)
135. 0.000 17.284 ↑ 1.0 1 8,642

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

136. 17.284 17.284 ↓ 0.0 0 8,642

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=8,642)

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

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=8,642)

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

Initplan (for Index Scan)

139. 0.000 0.000 ↓ 0.0 0 8,642

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=8,642)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
140. 0.000 17.284 ↑ 1.0 1 8,642

Aggregate (cost=12.41..12.42 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=8,642)

141. 17.284 17.284 ↓ 0.0 0 8,642

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=8,642)

  • 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 : 33.743 ms
Execution time : 2,370.082 ms