explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M6H6

Settings
# exclusive inclusive rows x rows loops node
1. 0.055 14,244.905 ↓ 5.9 100 1

Limit (cost=110,611.44..110,611.48 rows=17 width=3,094) (actual time=14,244.833..14,244.905 rows=100 loops=1)

2. 4.656 14,244.850 ↓ 5.9 100 1

Sort (cost=110,611.44..110,611.48 rows=17 width=3,094) (actual time=14,244.832..14,244.850 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. 15.834 14,240.194 ↓ 81.5 1,386 1

WindowAgg (cost=108,924.06..110,610.92 rows=17 width=3,094) (actual time=14,234.688..14,240.194 rows=1,386 loops=1)

4. 33.516 14,224.360 ↓ 81.5 1,386 1

Hash Right Join (cost=108,924.06..110,609.52 rows=17 width=2,692) (actual time=14,168.471..14,224.360 rows=1,386 loops=1)

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

Initplan (forHash Right Join)

6. 0.049 0.049 ↑ 1.0 1 1

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

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

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

8. 22.808 14,161.366 ↓ 346.5 1,386 1

Hash (cost=108,819.62..108,819.62 rows=4 width=2,162) (actual time=14,161.366..14,161.366 rows=1,386 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1720kB
9. 3.893 14,138.558 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.90..108,819.62 rows=4 width=2,162) (actual time=2,521.083..14,138.558 rows=1,386 loops=1)

10. 9.332 14,130.507 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.76..108,818.92 rows=4 width=2,122) (actual time=2,521.076..14,130.507 rows=1,386 loops=1)

  • Join Filter: (CASE WHEN ((sincronia_recursos_aceites_erp.recebimento_id IS NOT NULL) AND (recebimento.id IS NOT NULL)) THEN (sincronia_recursos_aceites_erp.recebimento_id = recebimento.id) ELSE true END AND (remessa.rem_numero = sincronia_recursos_aceites_erp.remessa))
  • Rows Removed by Join Filter: 2
11. 3.657 14,080.981 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.46..108,817.58 rows=4 width=2,087) (actual time=2,521.033..14,080.981 rows=1,386 loops=1)

12. 6.303 14,074.552 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.18..108,816.31 rows=4 width=2,017) (actual time=2,520.670..14,074.552 rows=1,386 loops=1)

13. 3,380.131 14,065.477 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.03..108,815.63 rows=4 width=2,001) (actual time=2,520.663..14,065.477 rows=1,386 loops=1)

14. 4.068 2,767.128 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,565.86..108,676.58 rows=1 width=1,929) (actual time=2,515.308..2,767.128 rows=1,386 loops=1)

15. 4.135 2,763.060 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,565.44..108,676.11 rows=1 width=1,912) (actual time=2,515.305..2,763.060 rows=1,386 loops=1)

16. 4.020 2,758.925 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,565.15..108,675.79 rows=1 width=1,889) (actual time=2,515.303..2,758.925 rows=1,386 loops=1)

17. 3.930 2,754.905 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,564.72..108,675.12 rows=1 width=1,820) (actual time=2,515.300..2,754.905 rows=1,386 loops=1)

18. 4.005 2,739.887 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,564.44..108,674.81 rows=1 width=1,816) (actual time=2,515.292..2,739.887 rows=1,386 loops=1)

19. 3.122 2,727.566 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,564.17..108,674.51 rows=1 width=1,783) (actual time=2,515.285..2,727.566 rows=1,386 loops=1)

20. 3.909 2,718.900 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,564.04..108,674.35 rows=1 width=1,719) (actual time=2,515.280..2,718.900 rows=1,386 loops=1)

21. 4.267 2,703.903 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,563.62..108,673.88 rows=1 width=1,685) (actual time=2,515.271..2,703.903 rows=1,386 loops=1)

22. 3.482 2,694.092 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,563.48..108,673.72 rows=1 width=1,653) (actual time=2,515.261..2,694.092 rows=1,386 loops=1)

23. 4.674 2,683.680 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,563.35..108,673.55 rows=1 width=1,621) (actual time=2,515.256..2,683.680 rows=1,386 loops=1)

24. 3.720 2,669.304 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,563.21..108,673.39 rows=1 width=1,589) (actual time=2,515.248..2,669.304 rows=1,386 loops=1)

25. 3.908 2,665.584 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,562.94..108,673.09 rows=1 width=1,546) (actual time=2,515.245..2,665.584 rows=1,386 loops=1)

26. 3.306 2,653.360 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,562.66..108,672.78 rows=1 width=1,528) (actual time=2,515.237..2,653.360 rows=1,386 loops=1)

27. 3.487 2,634.808 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,562.24..108,672.31 rows=1 width=1,496) (actual time=2,515.227..2,634.808 rows=1,386 loops=1)

28. 6.331 2,628.549 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,561.81..108,671.64 rows=1 width=1,498) (actual time=2,515.225..2,628.549 rows=1,386 loops=1)

29. 3.778 2,609.744 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,561.38..108,670.97 rows=1 width=1,474) (actual time=2,515.214..2,609.744 rows=1,386 loops=1)

30. 3.697 2,600.422 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,561.26..108,670.81 rows=1 width=1,410) (actual time=2,515.207..2,600.422 rows=1,386 loops=1)

31. 10.174 2,584.251 ↓ 1,386.0 1,386 1

Nested Loop Left Join (cost=108,560.84..108,670.34 rows=1 width=1,410) (actual time=2,515.196..2,584.251 rows=1,386 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
32. 7.026 2,557.445 ↓ 154.0 1,386 1

Nested Loop Left Join (cost=108,560.41..108,594.20 rows=9 width=1,072) (actual time=2,515.178..2,557.445 rows=1,386 loops=1)

33. 11.320 2,531.015 ↓ 154.0 1,386 1

Merge Left Join (cost=108,560.27..108,592.74 rows=9 width=1,040) (actual time=2,515.160..2,531.015 rows=1,386 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
34. 12.715 2,502.800 ↓ 154.0 1,386 1

Sort (cost=107,710.37..107,710.39 rows=9 width=1,029) (actual time=2,499.107..2,502.800 rows=1,386 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 1456kB
35. 2.606 2,490.085 ↓ 154.0 1,386 1

Hash Right Join (cost=107,671.35..107,710.23 rows=9 width=1,029) (actual time=2,485.449..2,490.085 rows=1,386 loops=1)

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

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

37. 2.669 2,458.137 ↓ 693.0 1,386 1

Hash (cost=107,571.32..107,571.32 rows=2 width=973) (actual time=2,458.137..2,458.137 rows=1,386 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 913kB
38. 1.099 2,455.468 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,518.43..107,571.32 rows=2 width=973) (actual time=2,022.965..2,455.468 rows=1,386 loops=1)

39. 1.618 2,452.983 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,518.01..107,570.42 rows=2 width=951) (actual time=2,022.962..2,452.983 rows=1,386 loops=1)

40. 1.008 2,449.979 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,517.86..107,570.08 rows=2 width=935) (actual time=2,022.955..2,449.979 rows=1,386 loops=1)

41. 0.517 2,448.971 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,517.59..107,569.47 rows=2 width=902) (actual time=2,022.951..2,448.971 rows=1,386 loops=1)

42. 1.705 2,445.682 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,517.45..107,569.14 rows=2 width=870) (actual time=2,022.945..2,445.682 rows=1,386 loops=1)

43. 1.220 2,442.591 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,517.31..107,568.81 rows=2 width=838) (actual time=2,022.942..2,442.591 rows=1,386 loops=1)

44. 1.096 2,438.599 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,517.18..107,568.48 rows=2 width=806) (actual time=2,022.931..2,438.599 rows=1,386 loops=1)

45. 0.530 2,437.503 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,516.90..107,567.88 rows=2 width=763) (actual time=2,022.929..2,437.503 rows=1,386 loops=1)

46. 1.548 2,434.201 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,516.63..107,567.27 rows=2 width=745) (actual time=2,022.921..2,434.201 rows=1,386 loops=1)

47. 1.286 2,429.881 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,516.34..107,566.63 rows=2 width=695) (actual time=2,022.635..2,429.881 rows=1,386 loops=1)

48. 2.131 2,424.437 ↓ 693.0 1,386 1

Nested Loop Left Join (cost=107,515.91..107,565.68 rows=2 width=642) (actual time=2,022.625..2,424.437 rows=1,386 loops=1)

49. 17.646 2,418.148 ↓ 693.0 1,386 1

GroupAggregate (cost=107,515.49..107,548.75 rows=2 width=217) (actual time=2,022.613..2,418.148 rows=1,386 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
50. 8.314 2,022.712 ↓ 3,855.0 7,710 1

Sort (cost=107,515.49..107,515.49 rows=2 width=110) (actual time=2,021.167..2,022.712 rows=7,710 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 1277kB
51. 3.360 2,014.398 ↓ 3,855.0 7,710 1

Subquery Scan on produtosinterno (cost=236.03..107,515.48 rows=2 width=110) (actual time=19.865..2,014.398 rows=7,710 loops=1)

52. 58.368 2,011.038 ↓ 3,855.0 7,710 1

Nested Loop Left Join (cost=236.03..107,515.46 rows=2 width=1,193) (actual time=19.864..2,011.038 rows=7,710 loops=1)

53. 7.101 1,574.880 ↓ 3,855.0 7,710 1

Nested Loop Left Join (cost=235.74..107,476.44 rows=2 width=174) (actual time=19.161..1,574.880 rows=7,710 loops=1)

54. 2.405 1,428.999 ↓ 3,855.0 7,710 1

Nested Loop (cost=235.31..107,472.14 rows=2 width=160) (actual time=18.755..1,428.999 rows=7,710 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 = '306577412'::bigint)
  • Filter: (comp_convenio = 'SulAmerica'::text)
56. 6.660 1,426.581 ↓ 3,855.0 7,710 1

Nested Loop (cost=235.04..107,463.83 rows=2 width=168) (actual time=18.740..1,426.581 rows=7,710 loops=1)

57. 34.894 1,389.081 ↓ 15.2 7,710 1

Nested Loop (cost=234.61..106,368.34 rows=506 width=152) (actual time=18.729..1,389.081 rows=7,710 loops=1)

58. 45.424 638.483 ↓ 42.9 65,064 1

Nested Loop (cost=234.17..102,692.72 rows=1,518 width=98) (actual time=18.146..638.483 rows=65,064 loops=1)

59. 1.480 51.628 ↓ 62.9 5,469 1

Nested Loop (cost=233.74..6,663.43 rows=87 width=25) (actual time=17.407..51.628 rows=5,469 loops=1)

60. 0.039 0.054 ↑ 1.0 23 1

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

  • Recheck Cond: (comp_convenio = 'SulAmerica'::text)
  • Heap Blocks: exact=8
61. 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 = 'SulAmerica'::text)
62. 10.005 50.094 ↓ 59.5 238 23

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=229.28..288.90 rows=4 width=33) (actual time=1.863..2.178 rows=238 loops=23)

  • Recheck Cond: ((guicompetencia = competenciaprestador_1.id) AND (guicompetenciaassoc = '306577412'::bigint))
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 265
  • Heap Blocks: exact=1608
63. 2.668 40.089 ↓ 0.0 0 23

BitmapAnd (cost=229.28..229.28 rows=15 width=0) (actual time=1.743..1.743 rows=0 loops=23)

64. 18.170 18.170 ↓ 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.790..0.790 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
65. 19.251 19.251 ↓ 1.1 11,553 23

Bitmap Index Scan on idx_fiboguia_guicompetenciaassoc_idx (cost=0.00..194.80 rows=10,449 width=0) (actual time=0.837..0.837 rows=11,553 loops=23)

  • Index Cond: (guicompetenciaassoc = '306577412'::bigint)
66. 541.431 541.431 ↑ 55.8 12 5,469

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoprestador (cost=0.44..1,097.09 rows=669 width=81) (actual time=0.045..0.099 rows=12 loops=5,469)

  • Index Cond: (prodguia = guiaprestador_1.id)
67. 715.704 715.704 ↓ 0.0 0 65,064

Index Scan using fiboproduto_pkey on fiboproduto produtoconvenio (cost=0.44..2.41 rows=1 width=62) (actual time=0.011..0.011 rows=0 loops=65,064)

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

Index Scan using fiboguia_pkey on fiboguia guiaconvenio_1 (cost=0.43..2.15 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=7,710)

  • Index Cond: (id = produtoconvenio.prodguia)
  • Filter: ((guicompetencia = '306577412'::bigint) AND (guiorigem = 'CONVENIO'::text))
69. 138.780 138.780 ↑ 1.0 1 7,710

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recursoproduto (cost=0.42..2.14 rows=1 width=30) (actual time=0.018..0.018 rows=1 loops=7,710)

  • Index Cond: (produtoprestador.id = rec_produto)
70. 7.710 7.710 ↓ 0.0 0 7,710

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.001..0.001 rows=0 loops=7,710)

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

SubPlan (forNested Loop Left Join)

72. 215.880 370.080 ↑ 1.0 1 7,710

Aggregate (cost=17.48..17.49 rows=1 width=32) (actual time=0.048..0.048 rows=1 loops=7,710)

73. 7.563 154.200 ↑ 1.0 1 7,710

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=97) (actual time=0.019..0.020 rows=1 loops=7,710)

74. 7.220 123.360 ↑ 1.0 1 7,710

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=37) (actual time=0.016..0.016 rows=1 loops=7,710)

75. 38.550 38.550 ↑ 1.0 1 7,710

Index Scan using idx_fiboglosasproduto_id_produto_idx on fiboglosasproduto glosasproduto (cost=0.43..8.45 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=7,710)

  • Index Cond: (id_produto = produtoconvenio.id)
76. 77.590 77.590 ↑ 1.0 1 7,759

Index Scan using fiboglosa_pkey on fiboglosa glosas_1 (cost=0.43..8.45 rows=1 width=45) (actual time=0.010..0.010 rows=1 loops=7,759)

  • Index Cond: (id = glosasproduto.elt)
77. 23.277 23.277 ↑ 1.0 1 7,759

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

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

SubPlan (forGroupAggregate)

79. 0.000 377.790 ↑ 1.0 1 7,710

Result (cost=16.55..16.56 rows=1 width=1) (actual time=0.049..0.049 rows=1 loops=7,710)

80.          

Initplan (forResult)

81. 377.790 377.790 ↓ 0.0 0 7,710

Seq Scan on anexo_recurso anexo_recurso_2 (cost=0.00..16.55 rows=1 width=0) (actual time=0.049..0.049 rows=0 loops=7,710)

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

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

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

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,386)

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

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,386)

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

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

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

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,386)

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

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,386)

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

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,386)

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

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

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

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,386)

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

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,386)

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

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,386)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
93. 14.038 16.895 ↑ 5.1 847 1

Sort (cost=849.90..860.70 rows=4,318 width=26) (actual time=16.037..16.895 rows=847 loops=1)

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

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

95. 19.404 19.404 ↑ 1.0 1 1,386

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

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

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

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

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,386)

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

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,386)

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

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

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

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,386)

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

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=48) (actual time=0.010..0.011 rows=1 loops=1,386)

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

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,386)

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

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,386)

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

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,386)

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

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,386)

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

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,386)

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

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

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

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

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

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,386)

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

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,386)

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

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,386)

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

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,386)

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

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,386)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
114. 69.300 7,918.218 ↑ 4.0 1 1,386

Hash Right Join (cost=100.17..139.00 rows=4 width=80) (actual time=3.426..5.713 rows=1 loops=1,386)

  • Hash Cond: (operadora_multitenant_convenio.id = operadoraoriginalconvenio.id_multitenant)
115. 7,821.198 7,821.198 ↑ 8.1 105 1,386

Foreign Scan on operadora_multitenant operadora_multitenant_convenio (cost=100.00..135.59 rows=853 width=72) (actual time=3.357..5.643 rows=105 loops=1,386)

116. 6.930 27.720 ↑ 1.0 1 1,386

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
117. 20.790 20.790 ↑ 1.0 1 1,386

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,386)

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

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

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

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

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

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.028..0.029 rows=1 loops=1,386)

  • 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. 4.158 4.158 ↓ 0.0 0 1,386

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,386)

  • 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.302 0.302 ↑ 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.302 rows=565 loops=1)

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

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,386)

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

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,386)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
127. 4.158 8.316 ↑ 1.0 1 1,386

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

128. 1.161 4.158 ↓ 0.0 0 1,386

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

129. 0.000 2.772 ↓ 0.0 0 1,386

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

130. 2.772 2.772 ↓ 0.0 0 1,386

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,386)

  • Index Cond: (id_guia = guiaconvenio.id)
131. 0.300 0.300 ↑ 1.0 1 75

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

  • Index Cond: (id = glosasguia.elt)
132. 0.225 0.225 ↑ 1.0 1 75

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

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

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

134. 2.772 2.772 ↓ 0.0 0 1,386

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,386)

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

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,386)

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

Initplan (forIndex Scan)

137. 2.772 2.772 ↓ 0.0 0 1,386

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,386)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
138. 1.386 4.158 ↑ 1.0 1 1,386

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

139. 2.772 2.772 ↓ 0.0 0 1,386

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,386)

  • 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.006..0.006 rows=0 loops=1)

Planning time : 40.063 ms
Execution time : 14,331.466 ms