explain.depesz.com

PostgreSQL's explain analyze made readable

Result: P3Qf

Settings
# exclusive inclusive rows x rows loops node
1. 0.055 15,551.518 ↓ 5.9 100 1

Limit (cost=108,001.98..108,002.02 rows=17 width=3,094) (actual time=15,551.449..15,551.518 rows=100 loops=1)

2. 6.055 15,551.463 ↓ 5.9 100 1

Sort (cost=108,001.98..108,002.02 rows=17 width=3,094) (actual time=15,551.447..15,551.463 rows=100 loops=1)

  • Sort Key: (COALESCE(round(((sum(produtosinterno.valorprodutoconvenio) - sum(produtosinterno.valorprodutoprestador))), 4), '0'::numeric))
  • Sort Method: top-N heapsort Memory: 226kB
3. 19.321 15,545.408 ↓ 101.5 1,726 1

WindowAgg (cost=106,314.60..108,001.46 rows=17 width=3,094) (actual time=15,538.492..15,545.408 rows=1,726 loops=1)

4. 39.772 15,526.087 ↓ 101.5 1,726 1

Hash Right Join (cost=106,314.60..108,000.06 rows=17 width=2,692) (actual time=15,462.169..15,526.087 rows=1,726 loops=1)

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

Initplan (for Hash Right Join)

6. 0.058 0.058 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 9.822 9.822 ↑ 8.1 105 1

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

8. 28.955 15,453.693 ↓ 431.5 1,726 1

Hash (cost=106,210.17..106,210.17 rows=4 width=2,162) (actual time=15,453.693..15,453.693 rows=1,726 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2117kB
9. 4.565 15,424.738 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,057.45..106,210.17 rows=4 width=2,162) (actual time=1,431.563..15,424.738 rows=1,726 loops=1)

10. 11.191 15,414.995 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,057.30..106,209.47 rows=4 width=2,122) (actual time=1,431.557..15,414.995 rows=1,726 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))
11. 4.037 15,355.476 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,057.01..106,208.13 rows=4 width=2,087) (actual time=1,431.525..15,355.476 rows=1,726 loops=1)

12. 9.674 15,349.713 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,056.72..106,206.85 rows=4 width=2,017) (actual time=1,431.201..15,349.713 rows=1,726 loops=1)

13. 4,038.865 15,338.313 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,056.58..106,206.17 rows=4 width=2,001) (actual time=1,431.196..15,338.313 rows=1,726 loops=1)

14. 4.720 1,742.586 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,956.41..106,067.13 rows=1 width=1,929) (actual time=1,421.042..1,742.586 rows=1,726 loops=1)

15. 4.862 1,737.866 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,955.99..106,066.66 rows=1 width=1,912) (actual time=1,421.039..1,737.866 rows=1,726 loops=1)

16. 4.609 1,733.004 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,955.70..106,066.34 rows=1 width=1,889) (actual time=1,421.036..1,733.004 rows=1,726 loops=1)

17. 4.991 1,728.395 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,955.27..106,065.66 rows=1 width=1,820) (actual time=1,421.034..1,728.395 rows=1,726 loops=1)

18. 4.523 1,709.596 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,954.99..106,065.36 rows=1 width=1,816) (actual time=1,421.019..1,709.596 rows=1,726 loops=1)

19. 5.483 1,694.717 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,954.71..106,065.05 rows=1 width=1,783) (actual time=1,421.011..1,694.717 rows=1,726 loops=1)

20. 6.242 1,684.056 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,954.59..106,064.90 rows=1 width=1,719) (actual time=1,421.006..1,684.056 rows=1,726 loops=1)

21. 5.091 1,665.732 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,954.17..106,064.43 rows=1 width=1,685) (actual time=1,420.984..1,665.732 rows=1,726 loops=1)

22. 4.413 1,653.737 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,954.03..106,064.26 rows=1 width=1,653) (actual time=1,420.979..1,653.737 rows=1,726 loops=1)

23. 5.682 1,640.694 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,953.90..106,064.10 rows=1 width=1,621) (actual time=1,420.974..1,640.694 rows=1,726 loops=1)

24. 4.566 1,622.930 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,953.76..106,063.94 rows=1 width=1,589) (actual time=1,420.966..1,622.930 rows=1,726 loops=1)

25. 4.746 1,618.364 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,953.48..106,063.63 rows=1 width=1,546) (actual time=1,420.964..1,618.364 rows=1,726 loops=1)

26. 4.806 1,603.262 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,953.21..106,063.33 rows=1 width=1,528) (actual time=1,420.956..1,603.262 rows=1,726 loops=1)

27. 4.689 1,567.388 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,952.79..106,062.86 rows=1 width=1,496) (actual time=1,420.945..1,567.388 rows=1,726 loops=1)

28. 5.887 1,559.247 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,952.36..106,062.19 rows=1 width=1,498) (actual time=1,420.942..1,559.247 rows=1,726 loops=1)

29. 4.255 1,534.374 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,951.93..106,061.51 rows=1 width=1,474) (actual time=1,420.634..1,534.374 rows=1,726 loops=1)

30. 4.075 1,523.215 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,951.81..106,061.36 rows=1 width=1,410) (actual time=1,420.627..1,523.215 rows=1,726 loops=1)

31. 14.093 1,503.606 ↓ 1,726.0 1,726 1

Nested Loop Left Join (cost=105,951.38..106,060.89 rows=1 width=1,410) (actual time=1,420.609..1,503.606 rows=1,726 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
32. 8.790 1,470.527 ↓ 191.8 1,726 1

Nested Loop Left Join (cost=105,950.96..105,984.75 rows=9 width=1,072) (actual time=1,420.593..1,470.527 rows=1,726 loops=1)

33. 12.409 1,437.573 ↓ 191.8 1,726 1

Merge Left Join (cost=105,950.82..105,983.28 rows=9 width=1,040) (actual time=1,420.567..1,437.573 rows=1,726 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
34. 13.033 1,412.642 ↓ 191.8 1,726 1

Sort (cost=105,100.92..105,100.94 rows=9 width=1,029) (actual time=1,408.128..1,412.642 rows=1,726 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 1801kB
35. 3.291 1,399.609 ↓ 191.8 1,726 1

Hash Right Join (cost=105,061.89..105,100.77 rows=9 width=1,029) (actual time=1,394.347..1,399.609 rows=1,726 loops=1)

  • Hash Cond: (operadora_multitenant_prestador.id = operadoraoriginalprestador.id_multitenant)
36. 126.392 126.392 ↑ 8.1 105 1

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

37. 2.668 1,269.926 ↓ 863.0 1,726 1

Hash (cost=104,961.87..104,961.87 rows=2 width=973) (actual time=1,269.926..1,269.926 rows=1,726 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1144kB
38. 0.304 1,267.258 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,908.97..104,961.87 rows=2 width=973) (actual time=816.889..1,267.258 rows=1,726 loops=1)

39. 1.499 1,261.776 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,908.55..104,960.96 rows=2 width=951) (actual time=816.887..1,261.776 rows=1,726 loops=1)

40. 1.160 1,258.551 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,908.41..104,960.62 rows=2 width=935) (actual time=816.880..1,258.551 rows=1,726 loops=1)

41. 1.886 1,257.391 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,908.13..104,960.01 rows=2 width=902) (actual time=816.878..1,257.391 rows=1,726 loops=1)

42. 1.873 1,253.779 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,908.00..104,959.69 rows=2 width=870) (actual time=816.872..1,253.779 rows=1,726 loops=1)

43. 0.964 1,250.180 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,907.86..104,959.36 rows=2 width=838) (actual time=816.868..1,250.180 rows=1,726 loops=1)

44. 1.195 1,245.764 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,907.72..104,959.03 rows=2 width=806) (actual time=816.859..1,245.764 rows=1,726 loops=1)

45. 1.836 1,244.569 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,907.45..104,958.42 rows=2 width=763) (actual time=816.857..1,244.569 rows=1,726 loops=1)

46. 1.352 1,241.007 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,907.17..104,957.82 rows=2 width=745) (actual time=816.849..1,241.007 rows=1,726 loops=1)

47. 0.842 1,236.203 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,906.88..104,957.17 rows=2 width=695) (actual time=816.523..1,236.203 rows=1,726 loops=1)

48. 1.197 1,230.183 ↓ 863.0 1,726 1

Nested Loop Left Join (cost=104,906.46..104,956.23 rows=2 width=642) (actual time=816.514..1,230.183 rows=1,726 loops=1)

49. 12.863 1,223.808 ↓ 863.0 1,726 1

GroupAggregate (cost=104,906.03..104,939.30 rows=2 width=217) (actual time=816.505..1,223.808 rows=1,726 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
50. 6.695 817.696 ↓ 4,183.5 8,367 1

Sort (cost=104,906.03..104,906.04 rows=2 width=110) (actual time=816.424..817.696 rows=8,367 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 1561kB
51. 2.550 811.001 ↓ 4,183.5 8,367 1

Subquery Scan on produtosinterno (cost=228.19..104,906.02 rows=2 width=110) (actual time=18.037..811.001 rows=8,367 loops=1)

52. 43.315 808.451 ↓ 4,183.5 8,367 1

Nested Loop Left Join (cost=228.19..104,906.00 rows=2 width=1,193) (actual time=18.036..808.451 rows=8,367 loops=1)

53. 7.145 530.860 ↓ 4,183.5 8,367 1

Nested Loop Left Join (cost=227.90..104,866.98 rows=2 width=174) (actual time=17.891..530.860 rows=8,367 loops=1)

54. 1.871 506.981 ↓ 4,183.5 8,367 1

Nested Loop (cost=227.47..104,862.69 rows=2 width=160) (actual time=17.870..506.981 rows=8,367 loops=1)

55. 0.013 0.013 ↑ 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.012..0.013 rows=1 loops=1)

  • Index Cond: (id = '289603584'::bigint)
  • Filter: (comp_convenio = 'SulAmerica'::text)
56. 3.784 505.097 ↓ 4,183.5 8,367 1

Nested Loop (cost=227.20..104,854.37 rows=2 width=168) (actual time=17.855..505.097 rows=8,367 loops=1)

57. 0.000 476.212 ↓ 17.4 8,367 1

Nested Loop (cost=226.77..103,813.01 rows=481 width=152) (actual time=17.843..476.212 rows=8,367 loops=1)

58. 49.847 190.811 ↓ 66.7 96,386 1

Nested Loop (cost=226.33..100,316.57 rows=1,444 width=98) (actual time=17.174..190.811 rows=96,386 loops=1)

59. 0.939 40.374 ↓ 57.7 4,790 1

Nested Loop (cost=225.90..6,392.20 rows=83 width=25) (actual time=16.345..40.374 rows=4,790 loops=1)

60. 0.037 0.059 ↑ 1.0 23 1

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

  • Recheck Cond: (comp_convenio = 'SulAmerica'::text)
  • Heap Blocks: exact=8
61. 0.022 0.022 ↑ 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.022..0.022 rows=23 loops=1)

  • Index Cond: (comp_convenio = 'SulAmerica'::text)
62. 6.394 39.376 ↓ 52.0 208 23

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=221.44..277.11 rows=4 width=33) (actual time=1.532..1.712 rows=208 loops=23)

  • Recheck Cond: ((guicompetencia = competenciaprestador_1.id) AND (guicompetenciaassoc = '289603584'::bigint))
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 234
  • Heap Blocks: exact=1448
63. 2.369 32.982 ↓ 0.0 0 23

BitmapAnd (cost=221.44..221.44 rows=14 width=0) (actual time=1.434..1.434 rows=0 loops=23)

64. 15.594 15.594 ↓ 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.678..0.678 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
65. 15.019 15.019 ↓ 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.653..0.653 rows=10,178 loops=23)

  • Index Cond: (guicompetenciaassoc = '289603584'::bigint)
66. 100.590 100.590 ↑ 33.5 20 4,790

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoprestador (cost=0.44..1,124.93 rows=669 width=81) (actual time=0.015..0.021 rows=20 loops=4,790)

  • Index Cond: (prodguia = guiaprestador_1.id)
67. 289.158 289.158 ↓ 0.0 0 96,386

Index Scan using fiboproduto_pkey on fiboproduto produtoconvenio (cost=0.44..2.41 rows=1 width=62) (actual time=0.003..0.003 rows=0 loops=96,386)

  • Index Cond: (id = produtoprestador.prodassoc)
  • Filter: ((COALESCE(prodvlrtotal, '0'::numeric) - COALESCE(produtoprestador.prodvlrtotal, '0'::numeric)) < '0'::numeric)
  • Rows Removed by Filter: 1
68. 25.101 25.101 ↑ 1.0 1 8,367

Index Scan using fiboguia_pkey on fiboguia guiaconvenio_1 (cost=0.43..2.15 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=8,367)

  • Index Cond: (id = produtoconvenio.prodguia)
  • Filter: ((guicompetencia = '289603584'::bigint) AND (guiorigem = 'CONVENIO'::text))
69. 16.734 16.734 ↓ 0.0 0 8,367

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recursoproduto (cost=0.42..2.14 rows=1 width=30) (actual time=0.002..0.002 rows=0 loops=8,367)

  • Index Cond: (produtoprestador.id = rec_produto)
70. 0.000 0.000 ↓ 0.0 0 8,367

Index Only Scan using registro_envio_recurso_pkey on registro_envio_recurso registro_envio_item (cost=0.29..1.99 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=8,367)

  • Index Cond: (id = produtoprestador.registro_envio_recurso_id)
  • Heap Fetches: 6
71.          

SubPlan (for Nested Loop Left Join)

72. 158.973 234.276 ↑ 1.0 1 8,367

Aggregate (cost=17.48..17.49 rows=1 width=32) (actual time=0.028..0.028 rows=1 loops=8,367)

73. 8.343 75.303 ↑ 1.0 1 8,367

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=97) (actual time=0.008..0.009 rows=1 loops=8,367)

74. 8.343 50.202 ↑ 1.0 1 8,367

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=37) (actual time=0.005..0.006 rows=1 loops=8,367)

75. 25.101 25.101 ↑ 1.0 1 8,367

Index Scan using idx_fiboglosasproduto_id_produto_idx on fiboglosasproduto glosasproduto (cost=0.43..8.45 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=8,367)

  • Index Cond: (id_produto = produtoconvenio.id)
76. 16.758 16.758 ↑ 1.0 1 8,379

Index Scan using fiboglosa_pkey on fiboglosa glosas_1 (cost=0.43..8.45 rows=1 width=45) (actual time=0.002..0.002 rows=1 loops=8,379)

  • Index Cond: (id = glosasproduto.elt)
77. 16.758 16.758 ↑ 1.0 1 8,379

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo_1 (cost=0.29..0.31 rows=1 width=68) (actual time=0.002..0.002 rows=1 loops=8,379)

  • Index Cond: (id = glosas_1.glo_motivo)
78.          

SubPlan (for GroupAggregate)

79. 8.367 393.249 ↑ 1.0 1 8,367

Result (cost=16.55..16.56 rows=1 width=1) (actual time=0.047..0.047 rows=1 loops=8,367)

80.          

Initplan (for Result)

81. 384.882 384.882 ↓ 0.0 0 8,367

Seq Scan on anexo_recurso anexo_recurso_2 (cost=0.00..16.55 rows=1 width=0) (actual time=0.046..0.046 rows=0 loops=8,367)

  • Filter: ((entidade_id = produtosinterno.idprodutoprestador) AND (nivel = 'Produto'::text))
  • Rows Removed by Filter: 570
82. 5.178 5.178 ↑ 1.0 1 1,726

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=0.43..8.45 rows=1 width=434) (actual time=0.002..0.003 rows=1 loops=1,726)

  • Index Cond: (produtosinterno.idguiaprestador = id)
83. 5.178 5.178 ↑ 1.0 1 1,726

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

  • Index Cond: (guiaprestador.guibenefic = id)
84. 3.452 3.452 ↑ 1.0 1 1,726

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=1,726)

  • Index Cond: (guiaprestador.guiremessa = id)
85. 1.726 1.726 ↑ 1.0 1 1,726

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaprestador (cost=0.28..0.29 rows=1 width=26) (actual time=0.001..0.001 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.guicompetencia = id)
86. 0.000 0.000 ↓ 0.0 0 1,726

Index Scan using fibodefinicaomotivoglosa_pkey on fibodefinicaomotivoglosa motivoglosaprestador (cost=0.28..0.29 rows=1 width=59) (actual time=0.000..0.000 rows=0 loops=1,726)

  • Index Cond: (guiaprestador.guimotglosa = id)
87. 3.452 3.452 ↑ 1.0 1 1,726

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoinicialprestador (cost=0.14..0.16 rows=1 width=64) (actual time=0.002..0.002 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.guisituacaoguia = sitcodigo)
88. 1.726 1.726 ↑ 1.0 1 1,726

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoassociacaoprestador (cost=0.14..0.16 rows=1 width=64) (actual time=0.001..0.001 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.guisituacaoguiaassoc = sitcodigo)
89. 1.726 1.726 ↑ 1.0 1 1,726

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusprestadorconciliacao (cost=0.14..0.15 rows=1 width=64) (actual time=0.001..0.001 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.guistatusconciliacao = stcodigo)
90. 0.000 0.000 ↓ 0.0 0 1,726

Index Scan using fiboprestador_pkey on fiboprestador prestadororiginalprestador (cost=0.28..0.30 rows=1 width=41) (actual time=0.000..0.000 rows=0 loops=1,726)

  • Index Cond: (guiaprestador.guiprestoriginal = id)
91. 1.726 1.726 ↑ 1.0 1 1,726

Index Scan using fibooperadora_pkey on fibooperadora operadoraoriginalprestador (cost=0.14..0.16 rows=1 width=24) (actual time=0.001..0.001 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.guioperadoraoriginal = id)
92. 5.178 5.178 ↓ 0.0 0 1,726

Index Scan using quitacao_sistema_gestao_pkey on quitacao_sistema_gestao (cost=0.42..0.44 rows=1 width=30) (actual time=0.002..0.003 rows=0 loops=1,726)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
93. 10.644 12.522 ↑ 15.3 283 1

Sort (cost=849.90..860.70 rows=4,318 width=26) (actual time=12.410..12.522 rows=283 loops=1)

  • Sort Key: detalhes_quitacao_rpa.numero_remessa, detalhes_quitacao_rpa.nome_convenio
  • Sort Method: quicksort Memory: 500kB
94. 1.878 1.878 ↑ 1.0 4,318 1

Seq Scan on detalhes_quitacao_rpa (cost=0.00..589.18 rows=4,318 width=26) (actual time=0.013..1.878 rows=4,318 loops=1)

95. 24.164 24.164 ↑ 1.0 1 1,726

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusprestadoranalise (cost=0.14..0.15 rows=1 width=64) (actual time=0.013..0.014 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
96. 18.986 18.986 ↑ 1.0 1 1,726

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..8.45 rows=1 width=346) (actual time=0.011..0.011 rows=1 loops=1,726)

  • Index Cond: (produtosinterno.idguiaconvenio = id)
97. 15.534 15.534 ↑ 1.0 1 1,726

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloprestador (cost=0.42..0.46 rows=1 width=16) (actual time=0.008..0.009 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.guiprotocolo = id)
98. 6.904 6.904 ↑ 1.0 1 1,726

Index Scan using fibohospital_pkey on fibohospital hospitalprestador (cost=0.12..0.14 rows=1 width=72) (actual time=0.003..0.004 rows=1 loops=1,726)

  • Index Cond: (protocoloprestador.hospital = id)
99. 18.986 18.986 ↑ 1.0 1 1,726

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia guiarecurso (cost=0.43..0.66 rows=1 width=32) (actual time=0.010..0.011 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
100. 3.452 3.452 ↓ 0.0 0 1,726

Index Scan using fiboguia_pkey on fiboguia guiapagamentorecurso (cost=0.43..0.66 rows=1 width=14) (actual time=0.002..0.002 rows=0 loops=1,726)

  • Index Cond: (id = guiarecurso.guiguiaassoc)
101. 31.068 31.068 ↑ 1.0 1 1,726

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=48) (actual time=0.017..0.018 rows=1 loops=1,726)

  • Index Cond: (guiaconvenio.guibenefic = id)
102. 10.356 10.356 ↑ 1.0 1 1,726

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio (cost=0.28..0.29 rows=1 width=26) (actual time=0.005..0.006 rows=1 loops=1,726)

  • Index Cond: (guiaconvenio.guicompetencia = id)
103. 0.000 0.000 ↓ 0.0 0 1,726

Index Scan using fibodefinicaomotivoglosa_pkey on fibodefinicaomotivoglosa motivoglosaconvenio (cost=0.28..0.29 rows=1 width=59) (actual time=0.000..0.000 rows=0 loops=1,726)

  • Index Cond: (guiaconvenio.guimotglosa = id)
104. 12.082 12.082 ↑ 1.0 1 1,726

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoconvenio (cost=0.14..0.16 rows=1 width=64) (actual time=0.006..0.007 rows=1 loops=1,726)

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
105. 8.630 8.630 ↑ 1.0 1 1,726

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioconciliacao (cost=0.14..0.15 rows=1 width=64) (actual time=0.004..0.005 rows=1 loops=1,726)

  • Index Cond: (guiaconvenio.guistatusconciliacao = stcodigo)
106. 6.904 6.904 ↑ 1.0 1 1,726

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioanalise (cost=0.14..0.15 rows=1 width=64) (actual time=0.003..0.004 rows=1 loops=1,726)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
107. 12.082 12.082 ↑ 1.0 1 1,726

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

  • Index Cond: (guiaconvenio.guiprotocolo = id)
108. 5.178 5.178 ↑ 1.0 1 1,726

Index Scan using fibohospital_pkey on fibohospital hospitalconvenio (cost=0.12..0.14 rows=1 width=72) (actual time=0.003..0.003 rows=1 loops=1,726)

  • Index Cond: (protocoloconvenio.hospital = id)
109. 10.356 10.356 ↑ 1.0 1 1,726

Index Scan using fiboprestador_pkey on fiboprestador prestadororiginalconvenio (cost=0.28..0.30 rows=1 width=41) (actual time=0.005..0.006 rows=1 loops=1,726)

  • Index Cond: (guiaconvenio.guiprestoriginal = id)
110. 13.808 13.808 ↑ 1.0 1 1,726

Index Scan using recebimento_pkey on recebimento (cost=0.28..0.30 rows=1 width=12) (actual time=0.005..0.008 rows=1 loops=1,726)

  • Index Cond: (guiaconvenio.recebimento_id = id)
111. 0.000 0.000 ↓ 0.0 0 1,726

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=1,726)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
112. 0.000 0.000 ↓ 0.0 0 1,726

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=1,726)

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

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=1,726)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
114. 88.026 9,556.862 ↑ 4.0 1 1,726

Hash Right Join (cost=100.17..139.00 rows=4 width=80) (actual time=3.367..5.537 rows=1 loops=1,726)

  • Hash Cond: (operadora_multitenant_convenio.id = operadoraoriginalconvenio.id_multitenant)
115. 9,434.316 9,434.316 ↑ 8.1 105 1,726

Foreign Scan on operadora_multitenant operadora_multitenant_convenio (cost=100.00..135.59 rows=853 width=72) (actual time=3.297..5.466 rows=105 loops=1,726)

116. 8.630 34.520 ↑ 1.0 1 1,726

Hash (cost=0.16..0.16 rows=1 width=24) (actual time=0.020..0.020 rows=1 loops=1,726)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
117. 25.890 25.890 ↑ 1.0 1 1,726

Index Scan using fibooperadora_pkey on fibooperadora operadoraoriginalconvenio (cost=0.14..0.16 rows=1 width=24) (actual time=0.014..0.015 rows=1 loops=1,726)

  • Index Cond: (guiaconvenio.guioperadoraoriginal = id)
118. 1.726 1.726 ↓ 0.0 0 1,726

Index Scan using fibooperadora_pkey on fibooperadora operadoraoriginalcobrancaoriginal (cost=0.14..0.16 rows=1 width=24) (actual time=0.001..0.001 rows=0 loops=1,726)

  • Index Cond: (guiacobrancaoriginal.guioperadoraoriginal = id)
119. 1.726 1.726 ↓ 0.0 0 1,726

Index Scan using id_lote_recurso_pkey on lote_recurso (cost=0.29..0.31 rows=1 width=78) (actual time=0.001..0.001 rows=0 loops=1,726)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
120. 48.328 48.328 ↑ 1.0 1 1,726

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.027..0.028 rows=1 loops=1,726)

  • 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
121. 5.178 5.178 ↓ 0.0 0 1,726

Index Scan using idx_pendencia_guia_id_idx on pendencia (cost=0.15..0.17 rows=1 width=48) (actual time=0.003..0.003 rows=0 loops=1,726)

  • Index Cond: (guia_id = guiaprestador.id)
122.          

SubPlan (for Hash Right 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.298 0.298 ↑ 1.0 565 1

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

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

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=1,726)

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
126. 1.726 1.726 ↓ 0.0 0 1,726

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=1,726)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
127. 3.452 8.630 ↑ 1.0 1 1,726

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

128. 1.549 5.178 ↓ 0.0 0 1,726

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

129. 1.431 3.452 ↓ 0.0 0 1,726

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

130. 1.726 1.726 ↓ 0.0 0 1,726

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=1,726)

  • Index Cond: (id_guia = guiaconvenio.id)
131. 0.295 0.295 ↑ 1.0 1 59

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

  • Index Cond: (id = glosasguia.elt)
132. 0.177 0.177 ↑ 1.0 1 59

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

  • Index Cond: (id = glosas.glo_motivo)
133. 0.000 3.452 ↑ 1.0 1 1,726

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

134. 3.452 3.452 ↓ 0.0 0 1,726

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=1,726)

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

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=1,726)

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

Initplan (for Index Scan)

137. 3.452 3.452 ↓ 0.0 0 1,726

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia fiboguia_2 (cost=0.43..8.45 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=1,726)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
138. 1.726 5.178 ↑ 1.0 1 1,726

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

139. 3.452 3.452 ↓ 0.0 0 1,726

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=1,726)

  • 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.006 0.006 ↓ 0.0 0 1

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

Planning time : 40.768 ms
Execution time : 15,639.665 ms