explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iZ1k

Settings
# exclusive inclusive rows x rows loops node
1. 5.242 291.107 ↓ 150.1 1,651 1

Sort (cost=856,852.45..856,852.48 rows=11 width=1,989) (actual time=290.911..291.107 rows=1,651 loops=1)

  • Sort Key: (CASE WHEN (sum(produtoconvenio.prodvlrtotal) IS NULL) THEN (0.00 - sum(produtoprestador.prodvlrtotal)) WHEN (sum(produtoprestador.prodvlrtotal) IS NULL) THEN sum(produtoconvenio.prodvlrtotal) ELSE (sum(produtoconvenio.prodvlrtotal) - sum(produtoprestador.prodvlrtotal)) END)
  • Sort Method: quicksort Memory: 1789kB
2. 18.088 285.865 ↓ 150.1 1,651 1

Nested Loop Left Join (cost=648,060.82..856,852.15 rows=11 width=1,989) (actual time=57.993..285.865 rows=1,651 loops=1)

3. 1.564 262.824 ↓ 150.1 1,651 1

Nested Loop Left Join (cost=648,060.40..856,655.81 rows=11 width=1,760) (actual time=57.871..262.824 rows=1,651 loops=1)

4. 1.220 261.260 ↓ 150.1 1,651 1

Hash Left Join (cost=648,060.11..856,652.27 rows=11 width=1,748) (actual time=57.868..261.260 rows=1,651 loops=1)

  • Hash Cond: (protocolocobrancaoriginal.hospital = hospitalcobrancaoriginal.id)
5. 1.488 260.037 ↓ 150.1 1,651 1

Nested Loop Left Join (cost=648,059.08..856,651.09 rows=11 width=1,673) (actual time=57.858..260.037 rows=1,651 loops=1)

6. 2.297 258.549 ↓ 150.1 1,651 1

Hash Left Join (cost=648,058.66..856,645.88 rows=11 width=1,666) (actual time=57.855..258.549 rows=1,651 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadoraoriginalcobrancaoriginal.operadora_id)
  • Filter: (COALESCE(operadoraoriginalcobrancaoriginal.operadora_id, operadoraoriginalprestador.operadora_id, operadoraoriginalconvenio.operadora_id, '0'::bigint) = '36896821'::bigint)
  • Rows Removed by Filter: 2581
7. 2.686 256.208 ↓ 1.9 4,232 1

Hash Left Join (cost=648,049.85..856,603.94 rows=2,285 width=1,614) (actual time=57.804..256.208 rows=4,232 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guimotglosa = motivoglosacobrancaoriginal.id)
8. 2.751 253.232 ↓ 1.9 4,232 1

Hash Left Join (cost=648,009.06..856,554.57 rows=2,285 width=1,567) (actual time=57.508..253.232 rows=4,232 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guicompetencia = competenciacobrancaoriginal.id)
9. 3.900 250.256 ↓ 1.9 4,232 1

Nested Loop Left Join (cost=647,977.99..856,492.09 rows=2,285 width=1,557) (actual time=57.278..250.256 rows=4,232 loops=1)

10. 3.275 246.356 ↓ 1.9 4,232 1

Hash Left Join (cost=647,977.56..854,954.12 rows=2,285 width=1,408) (actual time=57.275..246.356 rows=4,232 loops=1)

  • Hash Cond: (protocoloconvenio.hospital = hospitalconvenio.id)
11. 2.406 243.078 ↓ 1.9 4,232 1

Hash Left Join (cost=647,976.54..854,921.68 rows=2,285 width=1,333) (actual time=57.266..243.078 rows=4,232 loops=1)

  • Hash Cond: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.operadora_id)
12. 4.537 240.632 ↓ 1.9 4,232 1

Nested Loop Left Join (cost=647,967.73..854,884.65 rows=2,285 width=1,322) (actual time=57.221..240.632 rows=4,232 loops=1)

13. 3.561 227.631 ↓ 1.9 4,232 1

Nested Loop Left Join (cost=647,967.30..853,800.99 rows=2,285 width=1,289) (actual time=57.213..227.631 rows=4,232 loops=1)

14. 3.466 224.070 ↓ 1.9 4,232 1

Hash Left Join (cost=647,967.01..853,065.24 rows=2,285 width=1,280) (actual time=57.210..224.070 rows=4,232 loops=1)

  • Hash Cond: (COALESCE(competenciaconvenio.comp_convenio, competenciaprestador.comp_convenio) = convenio.convnome)
15. 2.089 220.538 ↓ 1.9 4,232 1

Hash Left Join (cost=647,957.74..853,035.86 rows=2,285 width=1,252) (actual time=57.137..220.538 rows=4,232 loops=1)

  • Hash Cond: (guiaconvenio.guimotglosa = motivoglosaconvenio.id)
16. 3.118 218.162 ↓ 1.9 4,232 1

Hash Left Join (cost=647,916.95..852,986.49 rows=2,285 width=1,205) (actual time=56.845..218.162 rows=4,232 loops=1)

  • Hash Cond: (guiaconvenio.guicompetencia = competenciaconvenio.id)
17. 2.482 214.813 ↓ 1.9 4,232 1

Nested Loop Left Join (cost=647,885.88..852,924.00 rows=2,285 width=1,187) (actual time=56.606..214.813 rows=4,232 loops=1)

18. 5.590 203.867 ↓ 1.9 4,232 1

Nested Loop Left Join (cost=647,885.46..851,845.01 rows=2,285 width=1,140) (actual time=56.599..203.867 rows=4,232 loops=1)

19. 2.581 189.813 ↓ 1.9 4,232 1

Hash Left Join (cost=647,885.03..836,972.55 rows=2,285 width=1,142) (actual time=56.587..189.813 rows=4,232 loops=1)

  • Hash Cond: ((competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio) AND (remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa))
20. 3.152 184.384 ↓ 1.9 4,232 1

Hash Left Join (cost=647,231.08..836,301.41 rows=2,285 width=1,131) (actual time=53.723..184.384 rows=4,232 loops=1)

  • Hash Cond: (protocoloprestador.hospital = hospitalprestador.id)
21. 5.340 181.227 ↓ 1.9 4,232 1

Nested Loop Left Join (cost=647,230.06..836,268.97 rows=2,285 width=1,056) (actual time=53.713..181.227 rows=4,232 loops=1)

22. 3.094 167.423 ↓ 1.9 4,232 1

Hash Left Join (cost=647,229.64..835,173.07 rows=2,285 width=1,049) (actual time=53.699..167.423 rows=4,232 loops=1)

  • Hash Cond: (guiaprestador.guioperadoraoriginal = operadoraoriginalprestador.operadora_id)
23. 5.763 164.249 ↓ 1.9 4,232 1

Nested Loop Left Join (cost=647,220.82..835,136.05 rows=2,285 width=997) (actual time=53.611..164.249 rows=4,232 loops=1)

  • Filter: (COALESCE(guiaprestador.pronta_para_quitacao, guiaconvenio.pronta_para_quitacao) IS TRUE)
24. 2.098 150.022 ↑ 1.1 4,232 1

Hash Left Join (cost=647,220.40..804,942.66 rows=4,570 width=840) (actual time=53.601..150.022 rows=4,232 loops=1)

  • Hash Cond: (guiaprestador.guimotglosa = motivoglosaprestador.id)
25. 2.890 147.621 ↑ 1.1 4,232 1

Hash Left Join (cost=647,179.60..804,884.72 rows=4,570 width=793) (actual time=53.294..147.621 rows=4,232 loops=1)

  • Hash Cond: (guiaprestador.guicompetencia = competenciaprestador.id)
26. 2.958 144.487 ↑ 1.1 4,232 1

Nested Loop Left Join (cost=647,148.54..804,790.82 rows=4,570 width=783) (actual time=53.044..144.487 rows=4,232 loops=1)

27. 3.724 133.065 ↑ 1.1 4,232 1

Nested Loop Left Join (cost=647,148.25..803,314.80 rows=4,570 width=771) (actual time=53.028..133.065 rows=4,232 loops=1)

28. 4.875 120.877 ↑ 1.1 4,232 1

Nested Loop Left Join (cost=647,147.82..801,157.22 rows=4,570 width=724) (actual time=53.020..120.877 rows=4,232 loops=1)

29. 3.087 107.538 ↑ 1.1 4,232 1

Nested Loop Left Join (cost=647,147.40..771,412.28 rows=4,570 width=667) (actual time=53.013..107.538 rows=4,232 loops=1)

  • Filter: ((guiaprestador.gui_quitacao_sistema_gestao IS NOT NULL) IS FALSE)
30. 17.245 91.755 ↑ 1.2 4,232 1

GroupAggregate (cost=647,146.97..737,428.04 rows=5,136 width=553) (actual time=53.003..91.755 rows=4,232 loops=1)

  • Group Key: (COALESCE(produtoprestador.prodguia, guiaconvenio_1.guiguiaassoc)), (COALESCE(produtoconvenio.prodguia, guiaprestador_1.guiguiaassoc)), produtoprestador.id, produtoconvenio.id, guireferenciada.id, (COALESCE(recurso.rec_valor, '0'::numeric)), solicitante.med_crm, executante.med_crm, cc.cc_codigo
31. 9.842 53.350 ↑ 1.2 4,232 1

Sort (cost=647,146.97..647,159.81 rows=5,136 width=452) (actual time=51.912..53.350 rows=4,232 loops=1)

  • Sort Key: (COALESCE(produtoprestador.prodguia, guiaconvenio_1.guiguiaassoc)), (COALESCE(produtoconvenio.prodguia, guiaprestador_1.guiguiaassoc)), produtoprestador.id, produtoconvenio.id, guireferenciada.id, (COALESCE(recurso.rec_valor, '0'::numeric)), solicitante.med_crm, executante.med_crm, cc.cc_codigo
  • Sort Method: quicksort Memory: 2431kB
32. 1.756 43.508 ↑ 1.2 4,232 1

Hash Left Join (cost=9,671.02..646,830.43 rows=5,136 width=452) (actual time=18.064..43.508 rows=4,232 loops=1)

  • Hash Cond: (produtoprestador.prodexec = executante.id)
33. 1.489 40.913 ↑ 1.2 4,232 1

Hash Left Join (cost=9,561.00..646,687.50 rows=5,136 width=444) (actual time=17.216..40.913 rows=4,232 loops=1)

  • Hash Cond: (produtoprestador.prodsolic = solicitante.id)
34. 1.496 38.343 ↑ 1.2 4,232 1

Hash Left Join (cost=9,450.98..646,507.89 rows=5,136 width=446) (actual time=16.125..38.343 rows=4,232 loops=1)

  • Hash Cond: (produtoprestador.prodcc = cc.id)
35. 2.509 36.792 ↑ 1.2 4,232 1

Nested Loop Left Join (cost=9,448.49..646,435.81 rows=5,136 width=451) (actual time=16.057..36.792 rows=4,232 loops=1)

36. 2.303 30.051 ↑ 1.2 4,232 1

Hash Full Join (cost=9,448.07..634,356.67 rows=5,136 width=352) (actual time=16.041..30.051 rows=4,232 loops=1)

  • Hash Cond: (produtoconvenio.id = produtoprestador.prodassoc)
37. 0.000 12.553 ↑ 1.2 4,232 1

Nested Loop Left Join (cost=1.57..624,890.90 rows=5,136 width=149) (actual time=0.835..12.553 rows=4,232 loops=1)

38. 2.081 4.236 ↑ 1.2 4,232 1

Nested Loop (cost=1.14..617,663.31 rows=5,136 width=149) (actual time=0.046..4.236 rows=4,232 loops=1)

39. 0.049 0.481 ↑ 1.6 186 1

Nested Loop (cost=0.70..707.20 rows=295 width=16) (actual time=0.015..0.481 rows=186 loops=1)

40. 0.007 0.007 ↑ 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.007..0.007 rows=1 loops=1)

  • Index Cond: (id = '340688896'::bigint)
  • Filter: (comp_convenio = 'Embratel'::text)
41. 0.425 0.425 ↑ 1.6 186 1

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaconvenio_1 (cost=0.43..695.95 rows=295 width=24) (actual time=0.007..0.425 rows=186 loops=1)

  • Index Cond: (guicompetencia = '340688896'::bigint)
  • Filter: (guiorigem = 'CONVENIO'::text)
  • Rows Removed by Filter: 348
42. 1.674 1.674 ↑ 29.3 23 186

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoconvenio (cost=0.44..2,084.63 rows=675 width=141) (actual time=0.003..0.009 rows=23 loops=186)

  • Index Cond: (prodguia = guiaconvenio_1.id)
43. 8.464 8.464 ↑ 1.0 1 4,232

Index Only Scan using fiboguiareferenciada_pkey on fiboguiareferenciada guiareferenciadaconvenio (cost=0.43..1.40 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=4,232)

  • Index Cond: (id = produtoconvenio.prodguiareferenciada)
  • Heap Fetches: 0
44. 1.891 15.195 ↓ 54.3 4,232 1

Hash (cost=9,445.53..9,445.53 rows=78 width=211) (actual time=15.195..15.195 rows=4,232 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1113kB
45. 0.861 13.304 ↓ 54.3 4,232 1

Nested Loop (cost=19.70..9,445.53 rows=78 width=211) (actual time=0.840..13.304 rows=4,232 loops=1)

46. 1.995 3.979 ↓ 54.3 4,232 1

Nested Loop (cost=19.27..9,261.25 rows=78 width=194) (actual time=0.088..3.979 rows=4,232 loops=1)

47. 0.041 0.496 ↓ 46.5 186 1

Hash Join (cost=18.84..564.67 rows=4 width=16) (actual time=0.075..0.496 rows=186 loops=1)

  • Hash Cond: (guiaprestador_1.guicompetencia = competenciaprestador_1.id)
48. 0.413 0.413 ↓ 1.1 186 1

Index Scan using idx_fiboguia_guicompetenciaassoc_idx on fiboguia guiaprestador_1 (cost=0.43..545.61 rows=163 width=24) (actual time=0.028..0.413 rows=186 loops=1)

  • Index Cond: (guicompetenciaassoc = '340688896'::bigint)
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 244
49. 0.004 0.042 ↑ 1.0 22 1

Hash (cost=18.13..18.13 rows=22 width=8) (actual time=0.042..0.042 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
50. 0.019 0.038 ↑ 1.0 22 1

Bitmap Heap Scan on fibocompetencia competenciaprestador_1 (cost=4.45..18.13 rows=22 width=8) (actual time=0.024..0.038 rows=22 loops=1)

  • Recheck Cond: (comp_convenio = 'Embratel'::text)
  • Heap Blocks: exact=7
51. 0.019 0.019 ↑ 1.0 22 1

Bitmap Index Scan on idx_fibocompetencia_comp_convenio_idx (cost=0.00..4.44 rows=22 width=0) (actual time=0.019..0.019 rows=22 loops=1)

  • Index Cond: (comp_convenio = 'Embratel'::text)
52. 1.488 1.488 ↑ 29.3 23 186

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoprestador (cost=0.44..2,167.40 rows=675 width=186) (actual time=0.003..0.008 rows=23 loops=186)

  • Index Cond: (prodguia = guiaprestador_1.id)
53. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fiboguiareferenciada_pkey on fiboguiareferenciada guireferenciada (cost=0.43..2.35 rows=1 width=25) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: (id = produtoprestador.prodguiareferenciada)
54. 4.232 4.232 ↓ 0.0 0 4,232

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recurso (cost=0.42..2.34 rows=1 width=107) (actual time=0.001..0.001 rows=0 loops=4,232)

  • Index Cond: (rec_produto = produtoprestador.id)
55. 0.027 0.055 ↑ 1.0 66 1

Hash (cost=1.66..1.66 rows=66 width=11) (actual time=0.055..0.055 rows=66 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
56. 0.028 0.028 ↑ 1.0 66 1

Seq Scan on fibocentrodecusto cc (cost=0.00..1.66 rows=66 width=11) (actual time=0.011..0.028 rows=66 loops=1)

57. 0.495 1.081 ↑ 1.0 3,512 1

Hash (cost=66.12..66.12 rows=3,512 width=14) (actual time=1.081..1.081 rows=3,512 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 199kB
58. 0.586 0.586 ↑ 1.0 3,512 1

Seq Scan on fibomedico solicitante (cost=0.00..66.12 rows=3,512 width=14) (actual time=0.007..0.586 rows=3,512 loops=1)

59. 0.442 0.839 ↑ 1.0 3,512 1

Hash (cost=66.12..66.12 rows=3,512 width=14) (actual time=0.839..0.839 rows=3,512 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 199kB
60. 0.397 0.397 ↑ 1.0 3,512 1

Seq Scan on fibomedico executante (cost=0.00..66.12 rows=3,512 width=14) (actual time=0.003..0.397 rows=3,512 loops=1)

61.          

SubPlan (for GroupAggregate)

62. 8.464 21.160 ↑ 1.0 1 4,232

Aggregate (cost=17.49..17.50 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=4,232)

63. 0.000 12.696 ↓ 0.0 0 4,232

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=64) (actual time=0.003..0.003 rows=0 loops=4,232)

64. 3.347 12.696 ↓ 0.0 0 4,232

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=12) (actual time=0.003..0.003 rows=0 loops=4,232)

65. 8.464 8.464 ↓ 0.0 0 4,232

Index Scan Backward using fiboglosasproduto_pkey on fiboglosasproduto glosasproduto (cost=0.43..8.45 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=4,232)

  • Index Cond: (id_produto = produtoconvenio.id)
66. 0.885 0.885 ↑ 1.0 1 295

Index Scan using fiboglosa_pkey on fiboglosa glosas_1 (cost=0.43..8.45 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=295)

  • Index Cond: (glosasproduto.elt = id)
67. 0.590 0.590 ↑ 1.0 1 295

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo_convenio (cost=0.29..0.31 rows=1 width=68) (actual time=0.002..0.002 rows=1 loops=295)

  • Index Cond: (glosas_1.glo_motivo = id)
68. 12.696 12.696 ↑ 1.0 1 4,232

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=0.43..6.60 rows=1 width=170) (actual time=0.002..0.003 rows=1 loops=4,232)

  • Index Cond: ((COALESCE(produtoprestador.prodguia, guiaconvenio_1.guiguiaassoc)) = id)
  • Filter: (guiassociada IS TRUE)
69. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fiboguiareferenciada_pkey on fiboguiareferenciada guiareferenciada (cost=0.43..6.50 rows=1 width=73) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: (guireferenciada.id = id)
70. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioprestador (cost=0.42..0.46 rows=1 width=63) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: (guiareferenciada.beneficiario_id = id)
71. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fiboremessa_pkey on fiboremessa remessa (cost=0.29..0.31 rows=1 width=28) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: (COALESCE(guiareferenciada.remessa_id, guiaprestador.guiremessa) = id)
72. 0.107 0.244 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
73. 0.137 0.137 ↑ 1.0 803 1

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

74. 0.162 0.303 ↑ 1.0 1,013 1

Hash (cost=28.13..28.13 rows=1,013 width=63) (actual time=0.303..0.303 rows=1,013 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 106kB
75. 0.141 0.141 ↑ 1.0 1,013 1

Seq Scan on fibodefinicaomotivoglosa motivoglosaprestador (cost=0.00..28.13 rows=1,013 width=63) (actual time=0.005..0.141 rows=1,013 loops=1)

76. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..6.60 rows=1 width=165) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: ((COALESCE(produtoconvenio.prodguia, guiaprestador_1.guiguiaassoc)) = id)
77. 0.026 0.080 ↑ 1.2 105 1

Hash (cost=7.25..7.25 rows=125 width=60) (actual time=0.080..0.080 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
78. 0.054 0.054 ↑ 1.2 105 1

Seq Scan on view_smartdata_operadoras operadoraoriginalprestador (cost=0.00..7.25 rows=125 width=60) (actual time=0.006..0.054 rows=105 loops=1)

79. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloprestador (cost=0.42..0.47 rows=1 width=23) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: (guiaprestador.guiprotocolo = id)
80. 0.001 0.005 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=83) (actual time=0.005..0.005 rows=1 loops=1)

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

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

82. 0.802 2.848 ↑ 1.0 4,318 1

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

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

84. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fiboguiareferenciada_pkey on fiboguiareferenciada guiareferenciadaconv (cost=0.43..6.50 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: ((max(guiareferenciadaconvenio.id)) = id)
85. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=63) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: (guiaconvenio.guibenefic = id)
86. 0.117 0.231 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
87. 0.114 0.114 ↑ 1.0 803 1

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

88. 0.148 0.287 ↑ 1.0 1,013 1

Hash (cost=28.13..28.13 rows=1,013 width=63) (actual time=0.287..0.287 rows=1,013 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 106kB
89. 0.139 0.139 ↑ 1.0 1,013 1

Seq Scan on fibodefinicaomotivoglosa motivoglosaconvenio (cost=0.00..28.13 rows=1,013 width=63) (actual time=0.003..0.139 rows=1,013 loops=1)

90. 0.017 0.066 ↑ 1.0 101 1

Hash (cost=8.01..8.01 rows=101 width=28) (actual time=0.066..0.066 rows=101 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
91. 0.049 0.049 ↑ 1.0 101 1

Seq Scan on fiboconvenio convenio (cost=0.00..8.01 rows=101 width=28) (actual time=0.005..0.049 rows=101 loops=1)

92. 0.000 0.000 ↓ 0.0 0 4,232

Index Scan using fiboremessa_pkey on fiboremessa remessaconvenio (cost=0.29..0.31 rows=1 width=25) (actual time=0.000..0.000 rows=0 loops=4,232)

  • Index Cond: (guiaconvenio.guiremessa = id)
93. 8.464 8.464 ↑ 1.0 1 4,232

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloconvenio (cost=0.42..0.46 rows=1 width=41) (actual time=0.002..0.002 rows=1 loops=4,232)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
94. 0.018 0.040 ↑ 1.2 105 1

Hash (cost=7.25..7.25 rows=125 width=19) (actual time=0.040..0.040 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
95. 0.022 0.022 ↑ 1.2 105 1

Seq Scan on view_smartdata_operadoras operadoraoriginalconvenio (cost=0.00..7.25 rows=125 width=19) (actual time=0.003..0.022 rows=105 loops=1)

96. 0.001 0.003 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=83) (actual time=0.003..0.003 rows=1 loops=1)

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

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

98. 0.000 0.000 ↓ 0.0 0 4,232

Index Scan using fiboguia_pkey on fiboguia guiacobrancaoriginal (cost=0.43..0.66 rows=1 width=162) (actual time=0.000..0.000 rows=0 loops=4,232)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
99. 0.138 0.225 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
100. 0.087 0.087 ↑ 1.0 803 1

Seq Scan on fibocompetencia competenciacobrancaoriginal (cost=0.00..21.03 rows=803 width=26) (actual time=0.003..0.087 rows=803 loops=1)

101. 0.155 0.290 ↑ 1.0 1,013 1

Hash (cost=28.13..28.13 rows=1,013 width=63) (actual time=0.290..0.290 rows=1,013 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 106kB
102. 0.135 0.135 ↑ 1.0 1,013 1

Seq Scan on fibodefinicaomotivoglosa motivoglosacobrancaoriginal (cost=0.00..28.13 rows=1,013 width=63) (actual time=0.003..0.135 rows=1,013 loops=1)

103. 0.025 0.044 ↑ 1.2 105 1

Hash (cost=7.25..7.25 rows=125 width=60) (actual time=0.044..0.044 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
104. 0.019 0.019 ↑ 1.2 105 1

Seq Scan on view_smartdata_operadoras operadoraoriginalcobrancaoriginal (cost=0.00..7.25 rows=125 width=60) (actual time=0.003..0.019 rows=105 loops=1)

105. 0.000 0.000 ↓ 0.0 0 1,651

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocolocobrancaoriginal (cost=0.42..0.46 rows=1 width=23) (actual time=0.000..0.000 rows=0 loops=1,651)

  • Index Cond: (guiacobrancaoriginal.guiprotocolo = id)
106. 0.001 0.003 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=83) (actual time=0.003..0.003 rows=1 loops=1)

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

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

108. 0.000 0.000 ↓ 0.0 0 1,651

Index Scan using fiboremessa_pkey on fiboremessa remessacobrancaoriginal (cost=0.29..0.31 rows=1 width=28) (actual time=0.000..0.000 rows=0 loops=1,651)

  • Index Cond: (guiacobrancaoriginal.guiremessa = id)
109. 0.000 0.000 ↓ 0.0 0 1,651

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiariocobrancaoriginal (cost=0.42..0.46 rows=1 width=63) (actual time=0.000..0.000 rows=0 loops=1,651)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
110.          

SubPlan (for Nested Loop Left Join)

111. 1.651 4.953 ↑ 1.0 1 1,651

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

112. 0.000 3.302 ↓ 0.0 0 1,651

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

113. 0.000 3.302 ↓ 0.0 0 1,651

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

114. 3.302 3.302 ↓ 0.0 0 1,651

Index Scan using idx_fiboglosasguia_id_guia_idx on fiboglosasguia glosasguia (cost=0.28..8.30 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=1,651)

  • Index Cond: (id_guia = guiaconvenio.id)
115. 0.000 0.000 ↓ 0.0 0

Index Scan using fiboglosa_pkey on fiboglosa glosas (cost=0.43..8.45 rows=1 width=46) (never executed)

  • Index Cond: (id = glosasguia.elt)
116. 0.000 0.000 ↓ 0.0 0

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo (cost=0.29..0.31 rows=1 width=68) (never executed)

  • Index Cond: (id = glosas.glo_motivo)
Planning time : 17.494 ms
Execution time : 292.503 ms