explain.depesz.com

PostgreSQL's explain analyze made readable

Result: c3gG

Settings
# exclusive inclusive rows x rows loops node
1. 0.053 12,198.520 ↓ 5.9 100 1

Limit (cost=110,611.44..110,611.48 rows=17 width=3,094) (actual time=12,198.447..12,198.520 rows=100 loops=1)

2. 4.607 12,198.467 ↓ 5.9 100 1

Sort (cost=110,611.44..110,611.48 rows=17 width=3,094) (actual time=12,198.446..12,198.467 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.829 12,193.860 ↓ 81.5 1,386 1

WindowAgg (cost=108,924.06..110,610.92 rows=17 width=3,094) (actual time=12,188.446..12,193.860 rows=1,386 loops=1)

4. 33.152 12,178.031 ↓ 81.5 1,386 1

Hash Right Join (cost=108,924.06..110,609.52 rows=17 width=2,692) (actual time=12,122.293..12,178.031 rows=1,386 loops=1)

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

Initplan (forHash Right Join)

6. 0.048 0.048 ↑ 1.0 1 1

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

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

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

8. 23.336 12,115.976 ↓ 346.5 1,386 1

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

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1720kB
9. 3.909 12,092.640 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.90..108,819.62 rows=4 width=2,162) (actual time=1,022.569..12,092.640 rows=1,386 loops=1)

10. 9.039 12,084.573 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.76..108,818.92 rows=4 width=2,122) (actual time=1,022.562..12,084.573 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. 4.077 12,035.340 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.46..108,817.58 rows=4 width=2,087) (actual time=1,022.520..12,035.340 rows=1,386 loops=1)

12. 6.548 12,029.877 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.18..108,816.31 rows=4 width=2,017) (actual time=1,022.502..12,029.877 rows=1,386 loops=1)

13. 3,247.355 12,020.557 ↓ 346.5 1,386 1

Nested Loop Left Join (cost=108,666.03..108,815.63 rows=4 width=2,001) (actual time=1,022.495..12,020.557 rows=1,386 loops=1)

14. 4.026 1,262.468 ↓ 1,386.0 1,386 1

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

15. 4.156 1,258.442 ↓ 1,386.0 1,386 1

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

16. 3.851 1,254.286 ↓ 1,386.0 1,386 1

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

17. 3.971 1,250.435 ↓ 1,386.0 1,386 1

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

18. 3.862 1,235.376 ↓ 1,386.0 1,386 1

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

19. 4.339 1,223.198 ↓ 1,386.0 1,386 1

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

20. 5.237 1,214.701 ↓ 1,386.0 1,386 1

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

21. 4.139 1,199.762 ↓ 1,386.0 1,386 1

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

22. 3.473 1,190.079 ↓ 1,386.0 1,386 1

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

23. 4.448 1,179.676 ↓ 1,386.0 1,386 1

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

24. 3.592 1,165.526 ↓ 1,386.0 1,386 1

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

25. 3.639 1,161.934 ↓ 1,386.0 1,386 1

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

26. 3.544 1,149.979 ↓ 1,386.0 1,386 1

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

27. 3.481 1,133.961 ↓ 1,386.0 1,386 1

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

28. 5.967 1,127.708 ↓ 1,386.0 1,386 1

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

29. 3.498 1,110.653 ↓ 1,386.0 1,386 1

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

30. 4.567 1,101.611 ↓ 1,386.0 1,386 1

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

31. 11.492 1,085.956 ↓ 1,386.0 1,386 1

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

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

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

33. 11.461 1,032.876 ↓ 154.0 1,386 1

Merge Left Join (cost=108,560.27..108,592.74 rows=9 width=1,040) (actual time=1,016.711..1,032.876 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. 9.889 1,007.578 ↓ 154.0 1,386 1

Sort (cost=107,710.37..107,710.39 rows=9 width=1,029) (actual time=1,003.743..1,007.578 rows=1,386 loops=1)

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

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

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

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

37. 2.470 959.050 ↓ 693.0 1,386 1

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

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

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

39. 1.433 954.237 ↓ 693.0 1,386 1

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

40. 0.957 951.418 ↓ 693.0 1,386 1

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

41. 1.764 950.461 ↓ 693.0 1,386 1

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

42. 1.706 947.311 ↓ 693.0 1,386 1

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

43. 1.059 944.219 ↓ 693.0 1,386 1

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

44. 0.954 940.388 ↓ 693.0 1,386 1

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

45. 0.438 939.434 ↓ 693.0 1,386 1

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

46. 0.761 936.224 ↓ 693.0 1,386 1

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

47. 1.395 932.691 ↓ 693.0 1,386 1

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

48. 1.411 927.138 ↓ 693.0 1,386 1

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

49. 13.890 921.569 ↓ 693.0 1,386 1

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

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
50. 5.700 545.309 ↓ 3,855.0 7,710 1

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

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

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

52. 38.130 537.482 ↓ 3,855.0 7,710 1

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

53. 5.645 298.892 ↓ 3,855.0 7,710 1

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

54. 1.598 277.827 ↓ 3,855.0 7,710 1

Nested Loop (cost=235.31..107,472.14 rows=2 width=160) (actual time=16.897..277.827 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.011..0.013 rows=1 loops=1)

  • Index Cond: (id = '306577412'::bigint)
  • Filter: (comp_convenio = 'SulAmerica'::text)
56. 1.083 276.216 ↓ 3,855.0 7,710 1

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

57. 21.398 252.003 ↓ 15.2 7,710 1

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

58. 32.738 100.477 ↓ 42.9 65,064 1

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

59. 0.723 40.394 ↓ 62.9 5,469 1

Nested Loop (cost=233.74..6,663.43 rows=87 width=25) (actual time=16.848..40.394 rows=5,469 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.681 39.629 ↓ 59.5 238 23

Bitmap Heap Scan on fiboguia guiaprestador_1 (cost=229.28..288.90 rows=4 width=33) (actual time=1.575..1.723 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.392 33.948 ↓ 0.0 0 23

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

64. 15.065 15.065 ↓ 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.655..0.655 rows=10,233 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
65. 16.491 16.491 ↓ 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.717..0.717 rows=11,553 loops=23)

  • Index Cond: (guicompetenciaassoc = '306577412'::bigint)
66. 27.345 27.345 ↑ 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.002..0.005 rows=12 loops=5,469)

  • Index Cond: (prodguia = guiaprestador_1.id)
67. 130.128 130.128 ↓ 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.002..0.002 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. 23.130 23.130 ↑ 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.002..0.003 rows=1 loops=7,710)

  • Index Cond: (id = produtoconvenio.prodguia)
  • Filter: ((guicompetencia = '306577412'::bigint) AND (guiorigem = 'CONVENIO'::text))
69. 15.420 15.420 ↑ 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.002..0.002 rows=1 loops=7,710)

  • Index Cond: (produtoprestador.id = rec_produto)
70. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=7,710)

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

SubPlan (forNested Loop Left Join)

72. 138.780 200.460 ↑ 1.0 1 7,710

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

73. 7.612 61.680 ↑ 1.0 1 7,710

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

74. 7.612 38.550 ↑ 1.0 1 7,710

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

75. 15.420 15.420 ↑ 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.002..0.002 rows=1 loops=7,710)

  • Index Cond: (id_produto = produtoconvenio.id)
76. 15.518 15.518 ↑ 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.002..0.002 rows=1 loops=7,759)

  • Index Cond: (id = glosasproduto.elt)
77. 15.518 15.518 ↑ 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.002 rows=1 loops=7,759)

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

SubPlan (forGroupAggregate)

79. 7.710 362.370 ↑ 1.0 1 7,710

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

80.          

Initplan (forResult)

81. 354.660 354.660 ↓ 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.046..0.046 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.001..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. 1.386 1.386 ↑ 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.001 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. 12.132 13.837 ↑ 5.1 847 1

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

  • Sort Key: detalhes_quitacao_rpa.numero_remessa, detalhes_quitacao_rpa.nome_convenio
  • Sort Method: quicksort Memory: 500kB
94. 1.705 1.705 ↑ 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.705 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.013..0.014 rows=1 loops=1,386)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
96. 15.246 15.246 ↑ 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.011 rows=1 loops=1,386)

  • Index Cond: (produtosinterno.idguiaconvenio = id)
97. 11.088 11.088 ↑ 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.008 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. 11.088 11.088 ↑ 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.008..0.008 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. 12.474 12.474 ↑ 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.008..0.009 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. 9.702 9.702 ↑ 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.007 rows=1 loops=1,386)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
108. 4.158 4.158 ↑ 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.003 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,510.734 ↑ 4.0 1 1,386

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

  • Hash Cond: (operadora_multitenant_convenio.id = operadoraoriginalconvenio.id_multitenant)
115. 7,412.328 7,412.328 ↑ 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.227..5.348 rows=105 loops=1,386)

116. 8.316 29.106 ↑ 1.0 1 1,386

Hash (cost=0.16..0.16 rows=1 width=24) (actual time=0.021..0.021 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. 1.386 1.386 ↓ 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.001..0.001 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. 1.386 4.158 ↑ 1.0 1 1,386

Aggregate (cost=8.44..8.45 rows=1 width=32) (actual time=0.003..0.003 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.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.048 ms
Execution time : 12,290.297 ms