explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LSM8

Settings
# exclusive inclusive rows x rows loops node
1. 1.719 494.520 ↓ 175.0 525 1

Sort (cost=188,643.52..188,643.52 rows=3 width=1,989) (actual time=494.466..494.520 rows=525 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: 619kB
2. 6.177 492.801 ↓ 175.0 525 1

Nested Loop Left Join (cost=124,891.85..188,643.46 rows=3 width=1,989) (actual time=445.812..492.801 rows=525 loops=1)

3. 0.542 485.049 ↓ 175.0 525 1

Nested Loop Left Join (cost=124,891.42..188,589.91 rows=3 width=1,760) (actual time=445.731..485.049 rows=525 loops=1)

4. 0.574 484.507 ↓ 175.0 525 1

Nested Loop Left Join (cost=124,891.13..188,588.95 rows=3 width=1,748) (actual time=445.728..484.507 rows=525 loops=1)

5. 0.555 483.933 ↓ 175.0 525 1

Nested Loop Left Join (cost=124,891.01..188,588.49 rows=3 width=1,673) (actual time=445.723..483.933 rows=525 loops=1)

6. 0.512 483.378 ↓ 175.0 525 1

Hash Left Join (cost=124,890.59..188,587.07 rows=3 width=1,666) (actual time=445.720..483.378 rows=525 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadoraoriginalcobrancaoriginal.operadora_id)
  • Filter: (COALESCE(operadoraoriginalcobrancaoriginal.operadora_id, operadoraoriginalprestador.operadora_id, operadoraoriginalconvenio.operadora_id, '0'::bigint) = '7831552'::bigint)
7. 0.375 482.754 ↑ 1.2 525 1

Hash Left Join (cost=124,881.77..188,569.03 rows=637 width=1,614) (actual time=445.599..482.754 rows=525 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guimotglosa = motivoglosacobrancaoriginal.id)
8. 0.402 481.624 ↑ 1.2 525 1

Hash Left Join (cost=124,840.98..188,525.84 rows=637 width=1,567) (actual time=444.836..481.624 rows=525 loops=1)

  • Hash Cond: (guiacobrancaoriginal.guicompetencia = competenciacobrancaoriginal.id)
9. 0.545 480.628 ↑ 1.2 525 1

Nested Loop Left Join (cost=124,809.91..188,486.01 rows=637 width=1,557) (actual time=444.236..480.628 rows=525 loops=1)

10. 0.437 480.083 ↑ 1.2 525 1

Hash Left Join (cost=124,809.49..188,057.27 rows=637 width=1,408) (actual time=444.232..480.083 rows=525 loops=1)

  • Hash Cond: (protocoloconvenio.hospital = hospitalconvenio.id)
11. 0.492 479.640 ↑ 1.2 525 1

Hash Left Join (cost=124,808.46..188,047.48 rows=637 width=1,333) (actual time=444.218..479.640 rows=525 loops=1)

  • Hash Cond: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.operadora_id)
12. 0.830 479.052 ↑ 1.2 525 1

Nested Loop Left Join (cost=124,799.65..188,030.81 rows=637 width=1,322) (actual time=444.114..479.052 rows=525 loops=1)

13. 0.511 477.172 ↑ 1.2 525 1

Nested Loop Left Join (cost=124,799.23..187,728.71 rows=637 width=1,289) (actual time=444.102..477.172 rows=525 loops=1)

14. 0.468 476.661 ↑ 1.2 525 1

Hash Left Join (cost=124,798.94..187,523.61 rows=637 width=1,280) (actual time=444.098..476.661 rows=525 loops=1)

  • Hash Cond: (COALESCE(competenciaconvenio.comp_convenio, competenciaprestador.comp_convenio) = convenio.convnome)
15. 0.327 476.055 ↑ 1.2 525 1

Hash Left Join (cost=124,789.67..187,508.72 rows=637 width=1,252) (actual time=443.949..476.055 rows=525 loops=1)

  • Hash Cond: (guiaconvenio.guimotglosa = motivoglosaconvenio.id)
16. 0.493 474.986 ↑ 1.2 525 1

Hash Left Join (cost=124,748.87..187,465.53 rows=637 width=1,205) (actual time=443.201..474.986 rows=525 loops=1)

  • Hash Cond: (guiaconvenio.guicompetencia = competenciaconvenio.id)
17. 0.671 473.880 ↑ 1.2 525 1

Nested Loop Left Join (cost=124,717.81..187,425.71 rows=637 width=1,187) (actual time=442.579..473.880 rows=525 loops=1)

18. 0.470 472.159 ↑ 1.2 525 1

Nested Loop Left Join (cost=124,717.38..187,124.91 rows=637 width=1,140) (actual time=442.569..472.159 rows=525 loops=1)

19. 0.260 470.114 ↑ 1.2 525 1

Nested Loop Left Join (cost=124,716.96..182,217.72 rows=637 width=1,142) (actual time=442.534..470.114 rows=525 loops=1)

  • Join Filter: (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio)
20. 0.432 467.754 ↑ 1.2 525 1

Hash Left Join (cost=124,716.67..181,993.72 rows=637 width=1,131) (actual time=442.517..467.754 rows=525 loops=1)

  • Hash Cond: (protocoloprestador.hospital = hospitalprestador.id)
21. 0.414 467.313 ↑ 1.2 525 1

Nested Loop Left Join (cost=124,715.65..181,983.93 rows=637 width=1,056) (actual time=442.499..467.313 rows=525 loops=1)

22. 0.458 465.324 ↑ 1.2 525 1

Hash Left Join (cost=124,715.23..181,678.43 rows=637 width=1,049) (actual time=442.484..465.324 rows=525 loops=1)

  • Hash Cond: (guiaprestador.guioperadoraoriginal = operadoraoriginalprestador.operadora_id)
23. 0.476 464.738 ↑ 1.2 525 1

Nested Loop Left Join (cost=124,706.42..181,661.76 rows=637 width=997) (actual time=442.346..464.738 rows=525 loops=1)

  • Filter: (COALESCE(guiaprestador.pronta_para_quitacao, guiaconvenio.pronta_para_quitacao) IS TRUE)
24. 0.283 462.687 ↑ 2.4 525 1

Hash Left Join (cost=124,705.99..171,811.78 rows=1,274 width=840) (actual time=442.330..462.687 rows=525 loops=1)

  • Hash Cond: (guiaprestador.guimotglosa = motivoglosaprestador.id)
25. 0.437 461.609 ↑ 2.4 525 1

Hash Left Join (cost=124,665.20..171,766.20 rows=1,274 width=793) (actual time=441.528..461.609 rows=525 loops=1)

  • Hash Cond: (guiaprestador.guicompetencia = competenciaprestador.id)
26. 0.701 460.551 ↑ 2.4 525 1

Nested Loop Left Join (cost=124,634.13..171,717.61 rows=1,274 width=783) (actual time=440.893..460.551 rows=525 loops=1)

27. 0.426 458.800 ↑ 2.4 525 1

Nested Loop Left Join (cost=124,633.84..171,306.14 rows=1,274 width=771) (actual time=440.880..458.800 rows=525 loops=1)

28. 0.525 456.799 ↑ 2.4 525 1

Nested Loop Left Join (cost=124,633.42..170,704.66 rows=1,274 width=724) (actual time=440.864..456.799 rows=525 loops=1)

29. 0.901 454.699 ↑ 2.4 525 1

Nested Loop Left Join (cost=124,632.99..160,890.27 rows=1,274 width=667) (actual time=440.849..454.699 rows=525 loops=1)

  • Filter: ((guiaprestador.gui_quitacao_sistema_gestao IS NOT NULL) IS FALSE)
30. 2.474 452.223 ↑ 2.7 525 1

GroupAggregate (cost=124,632.56..149,804.39 rows=1,432 width=553) (actual time=440.829..452.223 rows=525 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. 1.253 440.299 ↑ 2.7 525 1

Sort (cost=124,632.56..124,636.14 rows=1,432 width=452) (actual time=440.117..440.299 rows=525 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: 295kB
32. 0.461 439.046 ↑ 2.7 525 1

Hash Left Join (cost=26,170.86..124,557.50 rows=1,432 width=452) (actual time=404.019..439.046 rows=525 loops=1)

  • Hash Cond: (produtoprestador.prodexec = executante.id)
33. 0.371 437.806 ↑ 2.7 525 1

Hash Left Join (cost=26,060.84..124,438.31 rows=1,432 width=444) (actual time=403.233..437.806 rows=525 loops=1)

  • Hash Cond: (produtoprestador.prodsolic = solicitante.id)
34. 0.362 436.565 ↑ 2.7 525 1

Hash Left Join (cost=25,950.82..124,308.89 rows=1,432 width=446) (actual time=402.357..436.565 rows=525 loops=1)

  • Hash Cond: (produtoprestador.prodcc = cc.id)
35. 0.461 436.177 ↑ 2.7 525 1

Nested Loop Left Join (cost=25,948.33..124,287.00 rows=1,432 width=451) (actual time=402.319..436.177 rows=525 loops=1)

36. 0.607 434.141 ↑ 2.7 525 1

Hash Full Join (cost=25,947.91..120,631.14 rows=1,432 width=352) (actual time=402.302..434.141 rows=525 loops=1)

  • Hash Cond: (produtoconvenio.id = produtoprestador.prodassoc)
37. 0.456 294.425 ↑ 2.7 525 1

Nested Loop Left Join (cost=12,472.21..107,150.06 rows=1,432 width=149) (actual time=263.181..294.425 rows=525 loops=1)

38. 0.594 291.344 ↑ 2.7 525 1

Nested Loop (cost=12,471.78..104,992.38 rows=1,432 width=149) (actual time=262.849..291.344 rows=525 loops=1)

39. 10.895 289.862 ↓ 1.8 148 1

Hash Join (cost=12,471.34..51,092.32 rows=82 width=16) (actual time=262.827..289.862 rows=148 loops=1)

  • Hash Cond: (guiaconvenio_1.guiprotocolo = protocoloconvenio_1.id)
40. 31.098 131.074 ↓ 8.2 135,242 1

Nested Loop (cost=0.70..38,559.19 rows=16,445 width=24) (actual time=0.027..131.074 rows=135,242 loops=1)

41. 0.317 0.317 ↑ 1.0 23 1

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio_1 (cost=0.28..144.52 rows=23 width=8) (actual time=0.013..0.317 rows=23 loops=1)

  • Filter: (comp_convenio = 'Bradesco'::text)
  • Rows Removed by Filter: 780
42. 99.659 99.659 ↓ 7.4 5,880 23

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaconvenio_1 (cost=0.43..1,662.26 rows=794 width=32) (actual time=0.345..4.333 rows=5,880 loops=23)

  • Index Cond: (guicompetencia = competenciaconvenio_1.id)
  • Filter: (guiorigem = 'CONVENIO'::text)
  • Rows Removed by Filter: 6775
43. 0.102 147.893 ↑ 3.2 605 1

Hash (cost=12,446.39..12,446.39 rows=1,940 width=8) (actual time=147.893..147.893 rows=605 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 40kB
44. 147.791 147.791 ↑ 3.2 605 1

Seq Scan on fiboprotocolo protocoloconvenio_1 (cost=0.00..12,446.39 rows=1,940 width=8) (actual time=31.226..147.791 rows=605 loops=1)

  • Filter: (to_char(data_pagto, 'yyyy-MM-dd'::text) = '2019-05-03'::text)
  • Rows Removed by Filter: 387421
45. 0.888 0.888 ↑ 168.8 4 148

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoconvenio (cost=0.44..650.57 rows=675 width=141) (actual time=0.005..0.006 rows=4 loops=148)

  • Index Cond: (prodguia = guiaconvenio_1.id)
46. 2.625 2.625 ↑ 1.0 1 525

Index Only Scan using fiboguiareferenciada_pkey on fiboguiareferenciada guiareferenciadaconvenio (cost=0.43..1.50 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=525)

  • Index Cond: (id = produtoconvenio.prodguiareferenciada)
  • Heap Fetches: 0
47. 0.452 139.109 ↓ 37.5 525 1

Hash (cost=13,475.52..13,475.52 rows=14 width=211) (actual time=139.109..139.109 rows=525 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 140kB
48. 0.576 138.657 ↓ 37.5 525 1

Nested Loop (cost=384.26..13,475.52 rows=14 width=211) (actual time=39.385..138.657 rows=525 loops=1)

49. 0.482 132.831 ↓ 37.5 525 1

Nested Loop (cost=383.84..13,439.65 rows=14 width=194) (actual time=39.164..132.831 rows=525 loops=1)

50. 3.823 122.433 ↓ 148.0 148 1

Nested Loop (cost=383.40..12,513.10 rows=1 width=16) (actual time=38.860..122.433 rows=148 loops=1)

51. 2.142 92.549 ↓ 54.6 8,687 1

Nested Loop (cost=382.98..12,105.97 rows=159 width=24) (actual time=14.457..92.549 rows=8,687 loops=1)

52. 1.287 64.346 ↓ 54.6 8,687 1

Nested Loop (cost=382.55..11,084.04 rows=159 width=16) (actual time=14.447..64.346 rows=8,687 loops=1)

53. 0.047 0.062 ↑ 1.0 23 1

Bitmap Heap Scan on fibocompetencia competenciaprestador_1 (cost=4.45..17.74 rows=23 width=8) (actual time=0.021..0.062 rows=23 loops=1)

  • Recheck Cond: (comp_convenio = 'Bradesco'::text)
  • Heap Blocks: exact=11
54. 0.015 0.015 ↑ 1.0 23 1

Bitmap Index Scan on idx_fibocompetencia_comp_convenio_idx (cost=0.00..4.45 rows=23 width=0) (actual time=0.015..0.015 rows=23 loops=1)

  • Index Cond: (comp_convenio = 'Bradesco'::text)
55. 9.729 62.997 ↓ 47.2 378 23

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=378.10..481.06 rows=8 width=24) (actual time=2.415..2.739 rows=378 loops=23)

  • Recheck Cond: ((guicompetencia = competenciaprestador_1.id) AND (guicompetenciaassoc = '328105984'::bigint))
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 380
  • Heap Blocks: exact=2274
56. 3.151 53.268 ↓ 0.0 0 23

BitmapAnd (cost=378.10..378.10 rows=26 width=0) (actual time=2.316..2.316 rows=0 loops=23)

57. 19.872 19.872 ↓ 7.2 12,655 23

Bitmap Index Scan on idx_fiboguia_guicompetencia_idx (cost=0.00..33.42 rows=1,755 width=0) (actual time=0.864..0.864 rows=12,655 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
58. 30.245 30.245 ↑ 1.1 17,417 23

Bitmap Index Scan on idx_fiboguia_guicompetenciaassoc_idx (cost=0.00..343.04 rows=18,482 width=0) (actual time=1.315..1.315 rows=17,417 loops=23)

  • Index Cond: (guicompetenciaassoc = '328105984'::bigint)
59. 26.061 26.061 ↑ 1.0 1 8,687

Index Scan using fiboguia_pkey on fiboguia guiaconvparaprestador (cost=0.43..6.42 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=8,687)

  • Index Cond: (id = guiaprestador_1.guiguiaassoc)
60. 26.061 26.061 ↓ 0.0 0 8,687

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloconvparaprestador (cost=0.42..2.55 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=8,687)

  • Index Cond: (id = guiaconvparaprestador.guiprotocolo)
  • Filter: (to_char(data_pagto, 'yyyy-MM-dd'::text) = '2019-05-03'::text)
  • Rows Removed by Filter: 1
61. 9.916 9.916 ↑ 168.8 4 148

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoprestador (cost=0.44..919.81 rows=675 width=186) (actual time=0.065..0.067 rows=4 loops=148)

  • Index Cond: (prodguia = guiaprestador_1.id)
62. 5.250 5.250 ↑ 1.0 1 525

Index Scan using fiboguiareferenciada_pkey on fiboguiareferenciada guireferenciada (cost=0.43..2.55 rows=1 width=25) (actual time=0.010..0.010 rows=1 loops=525)

  • Index Cond: (id = produtoprestador.prodguiareferenciada)
63. 1.575 1.575 ↓ 0.0 0 525

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recurso (cost=0.42..2.54 rows=1 width=107) (actual time=0.003..0.003 rows=0 loops=525)

  • Index Cond: (rec_produto = produtoprestador.id)
64. 0.010 0.026 ↑ 1.0 66 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
65. 0.016 0.016 ↑ 1.0 66 1

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

66. 0.430 0.870 ↑ 1.0 3,512 1

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

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

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

68. 0.424 0.779 ↑ 1.0 3,512 1

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

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

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

70.          

SubPlan (for GroupAggregate)

71. 5.250 9.450 ↑ 1.0 1 525

Aggregate (cost=17.49..17.50 rows=1 width=32) (actual time=0.018..0.018 rows=1 loops=525)

72. 0.399 4.200 ↓ 0.0 0 525

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=64) (actual time=0.007..0.008 rows=0 loops=525)

73. 0.399 3.150 ↓ 0.0 0 525

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=12) (actual time=0.006..0.006 rows=0 loops=525)

74. 2.100 2.100 ↓ 0.0 0 525

Index Scan Backward using fiboglosasproduto_pkey on fiboglosasproduto glosasproduto (cost=0.43..8.45 rows=1 width=12) (actual time=0.004..0.004 rows=0 loops=525)

  • Index Cond: (id_produto = produtoconvenio.id)
75. 0.651 0.651 ↑ 1.0 1 217

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

  • Index Cond: (glosasproduto.elt = id)
76. 0.651 0.651 ↑ 1.0 1 217

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

  • Index Cond: (glosas_1.glo_motivo = id)
77. 1.575 1.575 ↑ 1.0 1 525

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=0.43..7.72 rows=1 width=170) (actual time=0.003..0.003 rows=1 loops=525)

  • Index Cond: ((COALESCE(produtoprestador.prodguia, guiaconvenio_1.guiguiaassoc)) = id)
  • Filter: (guiassociada IS TRUE)
78. 1.575 1.575 ↑ 1.0 1 525

Index Scan using fiboguiareferenciada_pkey on fiboguiareferenciada guiareferenciada (cost=0.43..7.69 rows=1 width=73) (actual time=0.003..0.003 rows=1 loops=525)

  • Index Cond: (guireferenciada.id = id)
79. 1.575 1.575 ↑ 1.0 1 525

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioprestador (cost=0.42..0.46 rows=1 width=63) (actual time=0.003..0.003 rows=1 loops=525)

  • Index Cond: (guiareferenciada.beneficiario_id = id)
80. 1.050 1.050 ↑ 1.0 1 525

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

  • Index Cond: (COALESCE(guiareferenciada.remessa_id, guiaprestador.guiremessa) = id)
81. 0.337 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: 57kB
82. 0.284 0.284 ↑ 1.0 803 1

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

83. 0.407 0.795 ↑ 1.0 1,013 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 106kB
84. 0.388 0.388 ↑ 1.0 1,013 1

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

85. 1.575 1.575 ↑ 1.0 1 525

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..7.72 rows=1 width=165) (actual time=0.002..0.003 rows=1 loops=525)

  • Index Cond: ((COALESCE(produtoconvenio.prodguia, guiaprestador_1.guiguiaassoc)) = id)
86. 0.056 0.128 ↑ 1.2 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
87. 0.072 0.072 ↑ 1.2 105 1

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

88. 1.575 1.575 ↑ 1.0 1 525

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

  • Index Cond: (guiaprestador.guiprotocolo = id)
89. 0.003 0.009 ↑ 1.0 1 1

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

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

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

91. 2.100 2.100 ↓ 0.0 0 525

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=0 loops=525)

  • Index Cond: (remessa.rem_numero = numero_remessa)
92. 1.575 1.575 ↑ 1.0 1 525

Index Scan using fiboguiareferenciada_pkey on fiboguiareferenciada guiareferenciadaconv (cost=0.43..7.69 rows=1 width=14) (actual time=0.002..0.003 rows=1 loops=525)

  • Index Cond: ((max(guiareferenciadaconvenio.id)) = id)
93. 1.050 1.050 ↑ 1.0 1 525

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

  • Index Cond: (guiaconvenio.guibenefic = id)
94. 0.330 0.613 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
95. 0.283 0.283 ↑ 1.0 803 1

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

96. 0.405 0.742 ↑ 1.0 1,013 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 106kB
97. 0.337 0.337 ↑ 1.0 1,013 1

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

98. 0.048 0.138 ↑ 1.0 101 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
99. 0.090 0.090 ↑ 1.0 101 1

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

100. 0.000 0.000 ↓ 0.0 0 525

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

  • Index Cond: (guiaconvenio.guiremessa = id)
101. 1.050 1.050 ↑ 1.0 1 525

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

  • Index Cond: (guiaconvenio.guiprotocolo = id)
102. 0.041 0.096 ↑ 1.2 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
103. 0.055 0.055 ↑ 1.2 105 1

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

104. 0.003 0.006 ↑ 1.0 1 1

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

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

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

106. 0.000 0.000 ↓ 0.0 0 525

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

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
107. 0.332 0.594 ↑ 1.0 803 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
108. 0.262 0.262 ↑ 1.0 803 1

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

109. 0.425 0.755 ↑ 1.0 1,013 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 106kB
110. 0.330 0.330 ↑ 1.0 1,013 1

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

111. 0.054 0.112 ↑ 1.2 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
112. 0.058 0.058 ↑ 1.2 105 1

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

113. 0.000 0.000 ↓ 0.0 0 525

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

  • Index Cond: (guiacobrancaoriginal.guiprotocolo = id)
114. 0.000 0.000 ↓ 0.0 0 525

Index Scan using fibohospital_pkey on fibohospital hospitalcobrancaoriginal (cost=0.12..0.14 rows=1 width=83) (actual time=0.000..0.000 rows=0 loops=525)

  • Index Cond: (protocolocobrancaoriginal.hospital = id)
115. 0.000 0.000 ↓ 0.0 0 525

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

  • Index Cond: (guiacobrancaoriginal.guiremessa = id)
116. 0.000 0.000 ↓ 0.0 0 525

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

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

SubPlan (for Nested Loop Left Join)

118. 0.525 1.575 ↑ 1.0 1 525

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

119. 0.000 1.050 ↓ 0.0 0 525

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

120. 0.000 1.050 ↓ 0.0 0 525

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

121. 1.050 1.050 ↓ 0.0 0 525

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

  • Index Cond: (id_guia = guiaconvenio.id)
122. 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)
123. 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 : 16.772 ms
Execution time : 495.832 ms