explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Vn2D

Settings
# exclusive inclusive rows x rows loops node
1. 0.061 15,179.064 ↓ 5.9 100 1

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

2. 5.924 15,179.003 ↓ 5.9 100 1

Sort (cost=108,001.98..108,002.02 rows=17 width=3,094) (actual time=15,178.991..15,179.003 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.449 15,173.079 ↓ 101.5 1,726 1

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

4. 40.981 15,153.630 ↓ 101.5 1,726 1

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

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

Initplan (forHash 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. 7.486 7.486 ↑ 8.1 105 1

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

8. 28.453 15,082.377 ↓ 431.5 1,726 1

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

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

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

10. 9.737 15,044.422 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,057.30..106,209.47 rows=4 width=2,122) (actual time=1,196.642..15,044.422 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. 5.254 14,984.631 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,057.01..106,208.13 rows=4 width=2,087) (actual time=1,196.625..14,984.631 rows=1,726 loops=1)

12. 9.370 14,979.377 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,056.72..106,206.85 rows=4 width=2,017) (actual time=1,196.613..14,979.377 rows=1,726 loops=1)

13. 4,017.123 14,968.281 ↓ 431.5 1,726 1

Nested Loop Left Join (cost=106,056.58..106,206.17 rows=4 width=2,001) (actual time=1,196.609..14,968.281 rows=1,726 loops=1)

14. 4.869 1,489.226 ↓ 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,187.830..1,489.226 rows=1,726 loops=1)

15. 4.950 1,484.357 ↓ 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,187.827..1,484.357 rows=1,726 loops=1)

16. 4.749 1,479.407 ↓ 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,187.824..1,479.407 rows=1,726 loops=1)

17. 4.805 1,474.658 ↓ 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,187.822..1,474.658 rows=1,726 loops=1)

18. 4.433 1,456.045 ↓ 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,187.814..1,456.045 rows=1,726 loops=1)

19. 5.205 1,441.256 ↓ 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,187.807..1,441.256 rows=1,726 loops=1)

20. 6.366 1,430.873 ↓ 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,187.803..1,430.873 rows=1,726 loops=1)

21. 4.932 1,412.425 ↓ 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,187.795..1,412.425 rows=1,726 loops=1)

22. 4.216 1,400.589 ↓ 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,187.791..1,400.589 rows=1,726 loops=1)

23. 5.513 1,387.743 ↓ 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,187.787..1,387.743 rows=1,726 loops=1)

24. 4.499 1,370.148 ↓ 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,187.779..1,370.148 rows=1,726 loops=1)

25. 4.505 1,365.649 ↓ 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,187.776..1,365.649 rows=1,726 loops=1)

26. 5.261 1,350.788 ↓ 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,187.770..1,350.788 rows=1,726 loops=1)

27. 4.657 1,329.993 ↓ 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,187.762..1,329.993 rows=1,726 loops=1)

28. 7.301 1,321.884 ↓ 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,187.760..1,321.884 rows=1,726 loops=1)

29. 4.455 1,300.775 ↓ 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,187.752..1,300.775 rows=1,726 loops=1)

30. 5.368 1,289.416 ↓ 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,187.746..1,289.416 rows=1,726 loops=1)

31. 13.553 1,270.240 ↓ 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,187.736..1,270.240 rows=1,726 loops=1)

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

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

33. 12.421 1,205.171 ↓ 191.8 1,726 1

Merge Left Join (cost=105,950.82..105,983.28 rows=9 width=1,040) (actual time=1,187.706..1,205.171 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. 14.016 1,180.081 ↓ 191.8 1,726 1

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

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

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

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

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

37. 2.512 1,050.092 ↓ 863.0 1,726 1

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

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

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

39. 1.562 1,044.722 ↓ 863.0 1,726 1

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

40. 1.027 1,041.434 ↓ 863.0 1,726 1

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

41. 1.784 1,040.407 ↓ 863.0 1,726 1

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

42. 1.768 1,036.897 ↓ 863.0 1,726 1

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

43. 0.860 1,033.403 ↓ 863.0 1,726 1

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

44. 1.079 1,029.091 ↓ 863.0 1,726 1

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

45. 1.824 1,028.012 ↓ 863.0 1,726 1

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

46. 0.544 1,024.462 ↓ 863.0 1,726 1

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

47. 0.601 1,020.466 ↓ 863.0 1,726 1

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

48. 2.657 1,014.687 ↓ 863.0 1,726 1

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

49. 14.187 1,008.578 ↓ 863.0 1,726 1

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

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

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

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

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

52. 37.872 609.842 ↓ 4,183.5 8,367 1

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

53. 4.060 371.162 ↓ 4,183.5 8,367 1

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

54. 1.717 350.368 ↓ 4,183.5 8,367 1

Nested Loop (cost=227.47..104,862.69 rows=2 width=160) (actual time=15.961..350.368 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. 8.966 348.638 ↓ 4,183.5 8,367 1

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

57. 15.644 322.938 ↓ 17.4 8,367 1

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

58. 43.395 114.522 ↓ 66.7 96,386 1

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

59. 0.686 37.597 ↓ 57.7 4,790 1

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

60. 0.029 0.042 ↑ 1.0 23 1

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

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

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

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=221.44..277.11 rows=4 width=33) (actual time=1.471..1.603 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.300 31.671 ↓ 0.0 0 23

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

64. 14.881 14.881 ↓ 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.647..0.647 rows=10,233 loops=23)

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

  • Index Cond: (guicompetenciaassoc = '289603584'::bigint)
66. 33.530 33.530 ↑ 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.002..0.007 rows=20 loops=4,790)

  • Index Cond: (prodguia = guiaprestador_1.id)
67. 192.772 192.772 ↓ 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.002..0.002 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. 16.734 16.734 ↑ 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.002..0.002 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 (forNested Loop Left Join)

72. 133.872 200.808 ↑ 1.0 1 8,367

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

73. 8.343 66.936 ↑ 1.0 1 8,367

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

74. 8.343 41.835 ↑ 1.0 1 8,367

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

75. 16.734 16.734 ↑ 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.002 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.001..0.002 rows=1 loops=8,379)

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

SubPlan (forGroupAggregate)

79. 8.367 376.515 ↑ 1.0 1 8,367

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

80.          

Initplan (forResult)

81. 368.148 368.148 ↓ 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.044..0.044 rows=0 loops=8,367)

  • Filter: ((entidade_id = produtosinterno.idprodutoprestador) AND (nivel = 'Produto'::text))
  • Rows Removed by Filter: 570
82. 3.452 3.452 ↑ 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.002 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.001..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. 1.726 1.726 ↓ 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.001..0.001 rows=0 loops=1,726)

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

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

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

Seq Scan on detalhes_quitacao_rpa (cost=0.00..589.18 rows=4,318 width=26) (actual time=0.011..1.896 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. 13.808 13.808 ↑ 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.008 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. 13.808 13.808 ↑ 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.008..0.008 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. 15.534 15.534 ↑ 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.009..0.009 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,461.932 ↑ 4.0 1 1,726

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

  • Hash Cond: (operadora_multitenant_convenio.id = operadoraoriginalconvenio.id_multitenant)
115. 9,339.386 9,339.386 ↑ 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.279..5.411 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.013..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. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=1,726)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
120. 50.054 50.054 ↑ 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.029 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 (forHash 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.285 0.285 ↑ 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.285 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.002..0.003 rows=0 loops=1,726)

129. 0.000 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. 3.452 3.452 ↓ 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.002 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.004..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 (forIndex 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.005 0.005 ↓ 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.005 rows=0 loops=1)

Planning time : 39.165 ms
Execution time : 15,264.801 ms