explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EV2F

Settings
# exclusive inclusive rows x rows loops node
1. 0.058 5,652.672 ↓ 1.8 100 1

Limit (cost=452,277.93..452,278.07 rows=55 width=3,094) (actual time=5,652.599..5,652.672 rows=100 loops=1)

2. 8.365 5,652.614 ↓ 1.8 100 1

Sort (cost=452,277.93..452,278.07 rows=55 width=3,094) (actual time=5,652.599..5,652.614 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. 27.755 5,644.249 ↓ 46.1 2,533 1

WindowAgg (cost=446,905.00..452,275.79 rows=55 width=3,094) (actual time=5,634.093..5,644.249 rows=2,533 loops=1)

4. 54.364 5,616.494 ↓ 46.1 2,533 1

Hash Right Join (cost=446,905.00..452,271.25 rows=55 width=2,692) (actual time=5,531.268..5,616.494 rows=2,533 loops=1)

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

Initplan (forHash Right Join)

6. 0.035 0.035 ↑ 1.0 1 1

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

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

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

8. 10.490 5,516.113 ↓ 194.8 2,533 1

Hash (cost=446,800.45..446,800.45 rows=13 width=2,162) (actual time=5,516.113..5,516.113 rows=2,533 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2872kB
9. 3.003 5,505.623 ↓ 194.8 2,533 1

Nested Loop Left Join (cost=445,526.52..446,800.45 rows=13 width=2,162) (actual time=5,084.806..5,505.623 rows=2,533 loops=1)

10. 5.942 5,500.087 ↓ 194.8 2,533 1

Nested Loop Left Join (cost=445,526.38..446,798.18 rows=13 width=2,122) (actual time=5,084.796..5,500.087 rows=2,533 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: 5
11. 1.987 5,433.353 ↓ 194.8 2,533 1

Nested Loop Left Join (cost=445,526.08..446,793.81 rows=13 width=2,087) (actual time=5,084.399..5,433.353 rows=2,533 loops=1)

12. 3.448 5,400.970 ↓ 194.8 2,533 1

Nested Loop Left Join (cost=445,525.80..446,789.67 rows=13 width=2,017) (actual time=5,084.125..5,400.970 rows=2,533 loops=1)

13. 29.938 5,397.522 ↓ 194.8 2,533 1

Nested Loop Left Join (cost=445,525.65..446,787.46 rows=13 width=2,001) (actual time=5,084.120..5,397.522 rows=2,533 loops=1)

  • Join Filter: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.id)
  • Rows Removed by Join Filter: 260899
14. 2.933 5,342.254 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,420.29..446,617.55 rows=3 width=1,929) (actual time=5,076.874..5,342.254 rows=2,533 loops=1)

15. 3.334 5,339.321 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,419.87..446,616.13 rows=3 width=1,912) (actual time=5,076.871..5,339.321 rows=2,533 loops=1)

16. 2.994 5,335.987 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,419.58..446,615.16 rows=3 width=1,889) (actual time=5,076.868..5,335.987 rows=2,533 loops=1)

17. 3.152 5,332.993 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,419.15..446,613.15 rows=3 width=1,820) (actual time=5,076.864..5,332.993 rows=2,533 loops=1)

18. 2.506 5,322.242 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,418.87..446,612.23 rows=3 width=1,816) (actual time=5,076.661..5,322.242 rows=2,533 loops=1)

19. 3.801 5,317.203 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,418.60..446,611.31 rows=3 width=1,783) (actual time=5,076.637..5,317.203 rows=2,533 loops=1)

20. 2.581 5,310.869 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,418.47..446,610.86 rows=3 width=1,719) (actual time=5,076.631..5,310.869 rows=2,533 loops=1)

21. 2.350 5,288.024 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,418.05..446,609.43 rows=3 width=1,685) (actual time=5,076.390..5,288.024 rows=2,533 loops=1)

22. 4.208 5,280.608 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,417.91..446,608.95 rows=3 width=1,653) (actual time=5,076.386..5,280.608 rows=2,533 loops=1)

23. 3.907 5,271.334 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,417.78..446,608.46 rows=3 width=1,621) (actual time=5,076.369..5,271.334 rows=2,533 loops=1)

24. 2.850 5,259.828 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,417.64..446,607.96 rows=3 width=1,589) (actual time=5,076.349..5,259.828 rows=2,533 loops=1)

25. 1.949 5,256.978 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,417.37..446,607.06 rows=3 width=1,546) (actual time=5,076.345..5,256.978 rows=2,533 loops=1)

26. 4.192 5,247.430 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,417.09..446,606.15 rows=3 width=1,528) (actual time=5,076.336..5,247.430 rows=2,533 loops=1)

27. 3.138 5,200.177 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,416.67..446,604.73 rows=3 width=1,496) (actual time=5,076.316..5,200.177 rows=2,533 loops=1)

28. 2.567 5,197.039 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,416.24..446,602.71 rows=3 width=1,498) (actual time=5,076.311..5,197.039 rows=2,533 loops=1)

29. 2.018 5,179.274 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,415.81..446,600.69 rows=3 width=1,474) (actual time=5,076.082..5,179.274 rows=2,533 loops=1)

30. 4.316 5,172.190 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,415.69..446,600.24 rows=3 width=1,410) (actual time=5,076.052..5,172.190 rows=2,533 loops=1)

31. 5.808 5,107.082 ↓ 844.3 2,533 1

Nested Loop Left Join (cost=445,415.27..446,598.81 rows=3 width=1,410) (actual time=5,075.843..5,107.082 rows=2,533 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
32. 6.002 5,083.543 ↓ 18.6 2,533 1

Merge Left Join (cost=445,414.84..445,448.25 rows=136 width=1,072) (actual time=5,075.319..5,083.543 rows=2,533 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
33. 9.497 5,060.406 ↓ 18.6 2,533 1

Sort (cost=444,564.94..444,565.28 rows=136 width=1,061) (actual time=5,059.033..5,060.406 rows=2,533 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 2669kB
34. 2.101 5,050.909 ↓ 18.6 2,533 1

Merge Left Join (cost=444,558.99..444,560.12 rows=136 width=1,061) (actual time=5,048.224..5,050.909 rows=2,533 loops=1)

  • Merge Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
35. 8.381 5,048.520 ↓ 18.6 2,533 1

Sort (cost=444,557.54..444,557.88 rows=136 width=1,029) (actual time=5,048.171..5,048.520 rows=2,533 loops=1)

  • Sort Key: guiaprestador.guistatusanaliseglosa
  • Sort Method: quicksort Memory: 2669kB
36. 4.556 5,040.139 ↓ 18.6 2,533 1

Hash Right Join (cost=444,512.57..444,552.72 rows=136 width=1,029) (actual time=5,031.588..5,040.139 rows=2,533 loops=1)

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

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

38. 5.465 4,767.808 ↓ 79.2 2,533 1

Hash (cost=444,412.17..444,412.17 rows=32 width=973) (actual time=4,767.808..4,767.808 rows=2,533 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1575kB
39. 0.981 4,762.343 ↓ 79.2 2,533 1

Nested Loop Left Join (cost=443,535.75..444,412.17 rows=32 width=973) (actual time=3,397.690..4,762.343 rows=2,533 loops=1)

40. 1.456 4,741.098 ↓ 79.2 2,533 1

Nested Loop Left Join (cost=443,535.33..444,397.64 rows=32 width=951) (actual time=3,397.687..4,741.098 rows=2,533 loops=1)

41. 2.049 4,734.576 ↓ 79.2 2,533 1

Nested Loop Left Join (cost=443,535.19..444,392.20 rows=32 width=935) (actual time=3,397.674..4,734.576 rows=2,533 loops=1)

42. 2.051 4,732.527 ↓ 79.2 2,533 1

Hash Left Join (cost=443,534.91..444,382.44 rows=32 width=902) (actual time=3,397.670..4,732.527 rows=2,533 loops=1)

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
43. 1.800 4,730.445 ↓ 79.2 2,533 1

Hash Left Join (cost=443,533.57..444,380.66 rows=32 width=870) (actual time=3,397.631..4,730.445 rows=2,533 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
44. 2.639 4,728.620 ↓ 79.2 2,533 1

Hash Left Join (cost=443,532.01..444,378.66 rows=32 width=838) (actual time=3,397.595..4,728.620 rows=2,533 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
45. 2.235 4,725.733 ↓ 79.2 2,533 1

Nested Loop Left Join (cost=443,530.45..444,376.66 rows=32 width=806) (actual time=3,397.326..4,725.733 rows=2,533 loops=1)

46. 2.023 4,723.498 ↓ 79.2 2,533 1

Nested Loop Left Join (cost=443,530.17..444,366.97 rows=32 width=763) (actual time=3,397.322..4,723.498 rows=2,533 loops=1)

47. 2.192 4,716.409 ↓ 79.2 2,533 1

Nested Loop Left Join (cost=443,529.90..444,357.29 rows=32 width=745) (actual time=3,397.310..4,716.409 rows=2,533 loops=1)

48. 1.193 4,691.420 ↓ 79.2 2,533 1

Nested Loop Left Join (cost=443,529.61..444,346.99 rows=32 width=695) (actual time=3,397.061..4,691.420 rows=2,533 loops=1)

49. 4.800 4,502.785 ↓ 79.2 2,533 1

Nested Loop Left Join (cost=443,529.19..444,331.88 rows=32 width=642) (actual time=3,396.526..4,502.785 rows=2,533 loops=1)

50. 40.532 4,490.386 ↓ 79.2 2,533 1

GroupAggregate (cost=443,528.76..444,061.00 rows=32 width=217) (actual time=3,396.502..4,490.386 rows=2,533 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
51. 23.724 3,399.977 ↓ 619.0 19,809 1

Sort (cost=443,528.76..443,528.84 rows=32 width=110) (actual time=3,395.657..3,399.977 rows=19,809 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 3554kB
52. 7.469 3,376.253 ↓ 619.0 19,809 1

Subquery Scan on produtosinterno (cost=7,550.23..443,527.96 rows=32 width=110) (actual time=279.405..3,376.253 rows=19,809 loops=1)

53. 116.412 3,368.784 ↓ 619.0 19,809 1

Nested Loop Left Join (cost=7,550.23..443,527.64 rows=32 width=1,193) (actual time=279.403..3,368.784 rows=19,809 loops=1)

54. 13.228 2,341.158 ↓ 619.0 19,809 1

Nested Loop Left Join (cost=7,549.93..442,902.90 rows=32 width=174) (actual time=274.621..2,341.158 rows=19,809 loops=1)

55. 14.179 2,169.458 ↓ 619.0 19,809 1

Hash Join (cost=7,549.51..442,833.56 rows=32 width=160) (actual time=274.198..2,169.458 rows=19,809 loops=1)

  • Hash Cond: (guiaprestador_1.guicompetencia = competenciaprestador_1.id)
56. 15.518 2,155.209 ↓ 17.8 19,809 1

Nested Loop (cost=7,531.48..442,811.02 rows=1,116 width=168) (actual time=274.118..2,155.209 rows=19,809 loops=1)

57. 57.960 2,040.646 ↓ 5.2 19,809 1

Nested Loop (cost=7,531.05..434,448.62 rows=3,830 width=143) (actual time=273.685..2,040.646 rows=19,809 loops=1)

58. 42.662 970.224 ↓ 8.0 92,042 1

Nested Loop (cost=7,530.61..406,433.37 rows=11,490 width=70) (actual time=263.951..970.224 rows=92,042 loops=1)

59. 27.490 305.338 ↓ 13.1 8,642 1

Hash Join (cost=7,530.18..45,392.04 rows=660 width=16) (actual time=262.045..305.338 rows=8,642 loops=1)

  • Hash Cond: (guiaconvenio_1.guiprotocolo = protocoloconvenio_1.id)
60. 35.722 197.514 ↓ 8.1 135,242 1

Nested Loop (cost=0.70..37,793.22 rows=16,732 width=24) (actual time=0.348..197.514 rows=135,242 loops=1)

61. 0.401 0.401 ↑ 1.0 23 1

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio_1 (cost=0.28..114.46 rows=23 width=8) (actual time=0.010..0.401 rows=23 loops=1)

  • Filter: (comp_convenio = 'Bradesco'::text)
  • Rows Removed by Filter: 780
62. 161.391 161.391 ↓ 7.3 5,880 23

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaconvenio_1 (cost=0.43..1,630.10 rows=811 width=32) (actual time=0.577..7.017 rows=5,880 loops=23)

  • Index Cond: (guicompetencia = competenciaconvenio_1.id)
  • Filter: (guiorigem = 'CONVENIO'::text)
  • Rows Removed by Filter: 6775
63. 5.181 80.334 ↑ 1.0 15,228 1

Hash (cost=7,338.10..7,338.10 rows=15,310 width=8) (actual time=80.334..80.334 rows=15,228 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 723kB
64. 72.167 75.153 ↑ 1.0 15,228 1

Bitmap Heap Scan on fiboprotocolo protocoloconvenio_1 (cost=405.90..7,338.10 rows=15,310 width=8) (actual time=3.975..75.153 rows=15,228 loops=1)

  • Recheck Cond: ((data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone) AND (data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone))
  • Heap Blocks: exact=377
65. 2.986 2.986 ↑ 1.0 15,228 1

Bitmap Index Scan on idx_fiboprotocolo_data_pagto_idx (cost=0.00..402.07 rows=15,310 width=0) (actual time=2.986..2.986 rows=15,228 loops=1)

  • Index Cond: ((data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone) AND (data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone))
66. 622.224 622.224 ↑ 60.8 11 8,642

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoconvenio (cost=0.44..540.34 rows=669 width=62) (actual time=0.025..0.072 rows=11 loops=8,642)

  • Index Cond: (prodguia = guiaconvenio_1.id)
67. 1,012.462 1,012.462 ↓ 0.0 0 92,042

Index Scan using idx_fiboproduto_prodassoc_idx on fiboproduto produtoprestador (cost=0.44..2.43 rows=1 width=81) (actual time=0.011..0.011 rows=0 loops=92,042)

  • Index Cond: (prodassoc = produtoconvenio.id)
  • Filter: ((COALESCE(produtoconvenio.prodvlrtotal, '0'::numeric) - COALESCE(prodvlrtotal, '0'::numeric)) < '0'::numeric)
  • Rows Removed by Filter: 1
68. 99.045 99.045 ↑ 1.0 1 19,809

Index Scan using fiboguia_pkey on fiboguia guiaprestador_1 (cost=0.43..2.17 rows=1 width=33) (actual time=0.005..0.005 rows=1 loops=19,809)

  • Index Cond: (id = produtoprestador.prodguia)
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
69. 0.005 0.070 ↑ 1.0 23 1

Hash (cost=17.74..17.74 rows=23 width=8) (actual time=0.070..0.070 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
70. 0.042 0.065 ↑ 1.0 23 1

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

  • Recheck Cond: (comp_convenio = 'Bradesco'::text)
  • Heap Blocks: exact=11
71. 0.023 0.023 ↑ 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.023..0.023 rows=23 loops=1)

  • Index Cond: (comp_convenio = 'Bradesco'::text)
72. 158.472 158.472 ↑ 1.0 1 19,809

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recursoproduto (cost=0.42..2.16 rows=1 width=30) (actual time=0.008..0.008 rows=1 loops=19,809)

  • Index Cond: (produtoprestador.id = rec_produto)
73. 0.000 0.000 ↓ 0.0 0 19,809

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

  • Index Cond: (id = produtoprestador.registro_envio_recurso_id)
  • Heap Fetches: 268
74.          

SubPlan (forNested Loop Left Join)

75. 574.461 911.214 ↑ 1.0 1 19,809

Aggregate (cost=17.48..17.49 rows=1 width=32) (actual time=0.046..0.046 rows=1 loops=19,809)

76. 16.449 336.753 ↑ 1.0 1 19,809

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=97) (actual time=0.015..0.017 rows=1 loops=19,809)

77. 32.898 257.517 ↑ 1.0 1 19,809

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=37) (actual time=0.012..0.013 rows=1 loops=19,809)

78. 99.045 99.045 ↑ 1.0 1 19,809

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=19,809)

  • Index Cond: (id_produto = produtoconvenio.id)
79. 125.574 125.574 ↑ 1.0 1 20,929

Index Scan using fiboglosa_pkey on fiboglosa glosas_1 (cost=0.43..8.45 rows=1 width=45) (actual time=0.006..0.006 rows=1 loops=20,929)

  • Index Cond: (id = glosasproduto.elt)
80. 62.787 62.787 ↑ 1.0 1 20,929

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

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

SubPlan (forGroupAggregate)

82. 19.809 1,049.877 ↑ 1.0 1 19,809

Result (cost=16.55..16.56 rows=1 width=1) (actual time=0.053..0.053 rows=1 loops=19,809)

83.          

Initplan (forResult)

84. 1,030.068 1,030.068 ↓ 0.0 0 19,809

Seq Scan on anexo_recurso anexo_recurso_2 (cost=0.00..16.55 rows=1 width=0) (actual time=0.052..0.052 rows=0 loops=19,809)

  • Filter: ((entidade_id = produtosinterno.idprodutoprestador) AND (nivel = 'Produto'::text))
  • Rows Removed by Filter: 570
85. 7.599 7.599 ↑ 1.0 1 2,533

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=2,533)

  • Index Cond: (produtosinterno.idguiaprestador = id)
86. 187.442 187.442 ↑ 1.0 1 2,533

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioprestador (cost=0.42..0.46 rows=1 width=69) (actual time=0.073..0.074 rows=1 loops=2,533)

  • Index Cond: (guiaprestador.guibenefic = id)
87. 22.797 22.797 ↑ 1.0 1 2,533

Index Scan using fiboremessa_pkey on fiboremessa remessa (cost=0.29..0.31 rows=1 width=66) (actual time=0.009..0.009 rows=1 loops=2,533)

  • Index Cond: (guiaprestador.guiremessa = id)
88. 5.066 5.066 ↑ 1.0 1 2,533

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=2,533)

  • Index Cond: (guiaprestador.guicompetencia = id)
89. 0.000 0.000 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (guiaprestador.guimotglosa = id)
90. 0.019 0.248 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=64) (actual time=0.247..0.248 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
91. 0.229 0.229 ↑ 1.0 25 1

Seq Scan on fibosituacaoguia situacaoinicialprestador (cost=0.00..1.25 rows=25 width=64) (actual time=0.222..0.229 rows=25 loops=1)

92. 0.013 0.025 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=64) (actual time=0.025..0.025 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
93. 0.012 0.012 ↑ 1.0 25 1

Seq Scan on fibosituacaoguia situacaoassociacaoprestador (cost=0.00..1.25 rows=25 width=64) (actual time=0.006..0.012 rows=25 loops=1)

94. 0.009 0.031 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=64) (actual time=0.031..0.031 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
95. 0.022 0.022 ↑ 1.0 15 1

Seq Scan on fibostatusguia statusprestadorconciliacao (cost=0.00..1.15 rows=15 width=64) (actual time=0.019..0.022 rows=15 loops=1)

96. 0.000 0.000 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (guiaprestador.guiprestoriginal = id)
97. 5.066 5.066 ↑ 1.0 1 2,533

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

  • Index Cond: (guiaprestador.guioperadoraoriginal = id)
98. 20.264 20.264 ↓ 0.0 0 2,533

Index Scan using quitacao_sistema_gestao_pkey on quitacao_sistema_gestao (cost=0.42..0.44 rows=1 width=30) (actual time=0.007..0.008 rows=0 loops=2,533)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
99. 0.268 0.288 ↓ 168.9 2,534 1

Sort (cost=1.44..1.48 rows=15 width=64) (actual time=0.045..0.288 rows=2,534 loops=1)

  • Sort Key: statusprestadoranalise.stcodigo
  • Sort Method: quicksort Memory: 26kB
100. 0.020 0.020 ↑ 1.0 15 1

Seq Scan on fibostatusguia statusprestadoranalise (cost=0.00..1.15 rows=15 width=64) (actual time=0.018..0.020 rows=15 loops=1)

101. 11.309 17.135 ↑ 1.0 4,233 1

Sort (cost=849.90..860.70 rows=4,318 width=26) (actual time=16.277..17.135 rows=4,233 loops=1)

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

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

103. 17.731 17.731 ↑ 1.0 1 2,533

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

  • Index Cond: (produtosinterno.idguiaconvenio = id)
104. 60.792 60.792 ↑ 1.0 1 2,533

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloprestador (cost=0.42..0.46 rows=1 width=16) (actual time=0.024..0.024 rows=1 loops=2,533)

  • Index Cond: (guiaprestador.guiprotocolo = id)
105. 5.066 5.066 ↑ 1.0 1 2,533

Index Scan using fibohospital_pkey on fibohospital hospitalprestador (cost=0.12..0.14 rows=1 width=72) (actual time=0.001..0.002 rows=1 loops=2,533)

  • Index Cond: (protocoloprestador.hospital = id)
106. 15.198 15.198 ↑ 1.0 1 2,533

Index Scan using idx_fiboguia_guiidguiaprestador_idx on fiboguia guiarecurso (cost=0.43..0.66 rows=1 width=32) (actual time=0.005..0.006 rows=1 loops=2,533)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
107. 0.000 0.000 ↓ 0.0 0 2,533

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

  • Index Cond: (id = guiarecurso.guiguiaassoc)
108. 43.061 43.061 ↑ 1.0 1 2,533

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

  • Index Cond: (guiaconvenio.guibenefic = id)
109. 7.599 7.599 ↑ 1.0 1 2,533

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio (cost=0.28..0.29 rows=1 width=26) (actual time=0.002..0.003 rows=1 loops=2,533)

  • Index Cond: (guiaconvenio.guicompetencia = id)
110. 0.000 0.000 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (guiaconvenio.guimotglosa = id)
111. 7.599 7.599 ↑ 1.0 1 2,533

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoconvenio (cost=0.14..0.16 rows=1 width=64) (actual time=0.003..0.003 rows=1 loops=2,533)

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
112. 5.066 5.066 ↑ 1.0 1 2,533

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioconciliacao (cost=0.14..0.15 rows=1 width=64) (actual time=0.002..0.002 rows=1 loops=2,533)

  • Index Cond: (guiaconvenio.guistatusconciliacao = stcodigo)
113. 5.066 5.066 ↑ 1.0 1 2,533

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

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
114. 20.264 20.264 ↑ 1.0 1 2,533

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=2,533)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
115. 2.533 2.533 ↑ 1.0 1 2,533

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

  • Index Cond: (protocoloconvenio.hospital = id)
116. 2.533 2.533 ↓ 0.0 0 2,533

Index Scan using fiboprestador_pkey on fiboprestador prestadororiginalconvenio (cost=0.28..0.30 rows=1 width=41) (actual time=0.001..0.001 rows=0 loops=2,533)

  • Index Cond: (guiaconvenio.guiprestoriginal = id)
117. 7.599 7.599 ↑ 1.0 1 2,533

Index Scan using recebimento_pkey on recebimento (cost=0.28..0.30 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=2,533)

  • Index Cond: (guiaconvenio.recebimento_id = id)
118. 0.000 0.000 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
119. 0.000 0.000 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (guiacobrancaoriginal.guiremessa = id)
120. 0.000 0.000 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
121. 14.295 25.330 ↑ 4.3 104 2,533

Materialize (cost=105.36..150.87 rows=448 width=80) (actual time=0.003..0.010 rows=104 loops=2,533)

122. 0.053 11.035 ↑ 4.3 104 1

Hash Right Join (cost=105.36..148.63 rows=448 width=80) (actual time=7.182..11.035 rows=104 loops=1)

  • Hash Cond: (operadora_multitenant_convenio.id = operadoraoriginalconvenio.id_multitenant)
123. 10.937 10.937 ↑ 8.1 105 1

Foreign Scan on operadora_multitenant operadora_multitenant_convenio (cost=100.00..135.59 rows=853 width=72) (actual time=7.123..10.937 rows=105 loops=1)

124. 0.018 0.045 ↑ 1.0 104 1

Hash (cost=4.05..4.05 rows=105 width=24) (actual time=0.044..0.045 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
125. 0.027 0.027 ↑ 1.0 104 1

Seq Scan on fibooperadora operadoraoriginalconvenio (cost=0.00..4.05 rows=105 width=24) (actual time=0.007..0.027 rows=104 loops=1)

126. 0.000 0.000 ↓ 0.0 0 2,533

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

  • Index Cond: (guiacobrancaoriginal.guioperadoraoriginal = id)
127. 30.396 30.396 ↓ 0.0 0 2,533

Index Scan using id_lote_recurso_pkey on lote_recurso (cost=0.29..0.31 rows=1 width=78) (actual time=0.011..0.012 rows=0 loops=2,533)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
128. 60.792 60.792 ↑ 1.0 1 2,533

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.024..0.024 rows=1 loops=2,533)

  • 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
129. 2.533 2.533 ↓ 0.0 0 2,533

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

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

SubPlan (forHash Right Join)

131. 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))
132. 0.280 0.280 ↑ 1.0 565 1

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

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
133. 5.066 5.066 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
134. 2.533 2.533 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
135. 2.533 10.132 ↑ 1.0 1 2,533

Aggregate (cost=17.33..17.34 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=2,533)

136. 0.000 7.599 ↓ 0.0 0 2,533

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

137. 2.298 7.599 ↓ 0.0 0 2,533

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

138. 5.066 5.066 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (id_guia = guiaconvenio.id)
139. 0.235 0.235 ↑ 1.0 1 47

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

  • Index Cond: (id = glosasguia.elt)
140. 0.141 0.141 ↑ 1.0 1 47

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

  • Index Cond: (id = glosas.glo_motivo)
141. 2.533 7.599 ↑ 1.0 1 2,533

Aggregate (cost=8.44..8.45 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=2,533)

142. 5.066 5.066 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (guia_convenio_id = guiaconvenio.id)
143. 0.000 0.000 ↓ 0.0 0 2,533

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=2,533)

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

Initplan (forIndex Scan)

145. 2.533 2.533 ↓ 0.0 0 2,533

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

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
146. 2.533 7.599 ↑ 1.0 1 2,533

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

147. 5.066 5.066 ↓ 0.0 0 2,533

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=2,533)

  • Index Cond: (guicobrancaoriginal = guiaprestador.id)
  • Filter: (guisituacaoguia = 'PosAuditoria'::text)
  • Rows Removed by Filter: 0
148. 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
149. 0.007 0.007 ↓ 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.007 rows=0 loops=1)

Planning time : 153.656 ms
Execution time : 5,741.025 ms