explain.depesz.com

PostgreSQL's explain analyze made readable

Result: q7RI

Settings
# exclusive inclusive rows x rows loops node
1. 0.056 2,286.238 ↓ 1.8 100 1

Limit (cost=419,771.98..419,772.12 rows=55 width=3,051) (actual time=2,286.172..2,286.238 rows=100 loops=1)

2. 6.666 2,286.182 ↓ 1.8 100 1

Sort (cost=419,771.98..419,772.12 rows=55 width=3,051) (actual time=2,286.170..2,286.182 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.050 2,279.516 ↓ 40.0 2,198 1

WindowAgg (cost=414,504.43..419,769.84 rows=55 width=3,051) (actual time=2,271.248..2,279.516 rows=2,198 loops=1)

4. 32.383 2,260.466 ↓ 40.0 2,198 1

Hash Right Join (cost=414,504.43..419,765.30 rows=55 width=2,649) (actual time=2,208.595..2,260.466 rows=2,198 loops=1)

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

Initplan (forHash Right Join)

6. 0.023 0.023 ↑ 1.0 1 1

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

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

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

8. 5.749 2,198.164 ↓ 169.1 2,198 1

Hash (cost=414,399.88..414,399.88 rows=13 width=1,997) (actual time=2,198.163..2,198.164 rows=2,198 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2518kB
9. 0.752 2,192.415 ↓ 169.1 2,198 1

Nested Loop Left Join (cost=413,193.92..414,399.88 rows=13 width=1,997) (actual time=2,048.314..2,192.415 rows=2,198 loops=1)

10. 2.293 2,189.465 ↓ 169.1 2,198 1

Nested Loop Left Join (cost=413,193.77..414,397.61 rows=13 width=1,957) (actual time=2,048.308..2,189.465 rows=2,198 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: 14
11. 0.753 2,173.984 ↓ 169.1 2,198 1

Nested Loop Left Join (cost=413,193.48..414,393.24 rows=13 width=1,922) (actual time=2,048.289..2,173.984 rows=2,198 loops=1)

12. 1.894 2,171.033 ↓ 169.1 2,198 1

Nested Loop Left Join (cost=413,193.19..414,389.10 rows=13 width=1,852) (actual time=2,048.271..2,171.033 rows=2,198 loops=1)

13. 21.038 2,169.139 ↓ 169.1 2,198 1

Nested Loop Left Join (cost=413,193.05..414,386.89 rows=13 width=1,836) (actual time=2,048.265..2,169.139 rows=2,198 loops=1)

  • Join Filter: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.id)
  • Rows Removed by Join Filter: 226394
14. 1.835 2,130.517 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,087.71..414,217.23 rows=3 width=1,764) (actual time=2,042.835..2,130.517 rows=2,198 loops=1)

15. 1.814 2,128.682 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,087.29..414,215.81 rows=3 width=1,747) (actual time=2,042.832..2,128.682 rows=2,198 loops=1)

16. 1.935 2,126.868 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,087.00..414,214.85 rows=3 width=1,724) (actual time=2,042.829..2,126.868 rows=2,198 loops=1)

17. 1.078 2,124.933 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,086.57..414,212.83 rows=3 width=1,654) (actual time=2,042.827..2,124.933 rows=2,198 loops=1)

18. 2.714 2,119.459 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,086.29..414,211.91 rows=3 width=1,650) (actual time=2,042.819..2,119.459 rows=2,198 loops=1)

19. 1.480 2,116.745 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,086.02..414,211.00 rows=3 width=1,617) (actual time=2,042.812..2,116.745 rows=2,198 loops=1)

20. 2.707 2,113.067 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,085.89..414,210.54 rows=3 width=1,574) (actual time=2,042.809..2,113.067 rows=2,198 loops=1)

21. 2.413 2,105.964 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,085.47..414,209.12 rows=3 width=1,540) (actual time=2,042.800..2,105.964 rows=2,198 loops=1)

22. 0.740 2,101.353 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,085.33..414,208.63 rows=3 width=1,527) (actual time=2,042.796..2,101.353 rows=2,198 loops=1)

23. 1.935 2,096.217 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,085.20..414,208.14 rows=3 width=1,514) (actual time=2,042.790..2,096.217 rows=2,198 loops=1)

24. 1.698 2,089.886 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,085.06..414,207.65 rows=3 width=1,498) (actual time=2,042.777..2,089.886 rows=2,198 loops=1)

25. 0.912 2,088.188 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,084.79..414,206.74 rows=3 width=1,455) (actual time=2,042.775..2,088.188 rows=2,198 loops=1)

26. 1.006 2,082.880 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,084.51..414,205.83 rows=3 width=1,437) (actual time=2,042.768..2,082.880 rows=2,198 loops=1)

27. 0.636 2,075.280 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,084.09..414,204.41 rows=3 width=1,405) (actual time=2,042.759..2,075.280 rows=2,198 loops=1)

28. 2.460 2,072.446 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,083.66..414,202.39 rows=3 width=1,407) (actual time=2,042.756..2,072.446 rows=2,198 loops=1)

29. 1.739 2,065.590 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,083.23..414,200.37 rows=3 width=1,383) (actual time=2,042.743..2,065.590 rows=2,198 loops=1)

30. 1.869 2,061.653 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,083.11..414,199.92 rows=3 width=1,340) (actual time=2,042.735..2,061.653 rows=2,198 loops=1)

31. 2.490 2,055.388 ↓ 732.7 2,198 1

Nested Loop Left Join (cost=413,082.69..414,198.49 rows=3 width=1,340) (actual time=2,042.722..2,055.388 rows=2,198 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
32. 2.708 2,046.304 ↓ 17.2 2,198 1

Merge Left Join (cost=413,082.26..413,115.61 rows=128 width=1,001) (actual time=2,042.687..2,046.304 rows=2,198 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
33. 8.362 2,031.529 ↓ 17.2 2,198 1

Sort (cost=412,232.35..412,232.67 rows=128 width=990) (actual time=2,030.699..2,031.529 rows=2,198 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 2329kB
34. 2.314 2,023.167 ↓ 17.2 2,198 1

Merge Left Join (cost=412,226.83..412,227.87 rows=128 width=990) (actual time=2,020.243..2,023.167 rows=2,198 loops=1)

  • Merge Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
35. 5.954 2,020.567 ↓ 17.2 2,198 1

Sort (cost=412,225.39..412,225.71 rows=128 width=977) (actual time=2,020.184..2,020.567 rows=2,198 loops=1)

  • Sort Key: guiaprestador.guistatusanaliseglosa
  • Sort Method: quicksort Memory: 2329kB
36. 3.219 2,014.613 ↓ 17.2 2,198 1

Hash Right Join (cost=412,180.84..412,220.91 rows=128 width=977) (actual time=2,009.151..2,014.613 rows=2,198 loops=1)

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

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

38. 3.584 1,749.100 ↓ 73.3 2,198 1

Hash (cost=412,080.46..412,080.46 rows=30 width=921) (actual time=1,749.099..1,749.100 rows=2,198 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1356kB
39. 2.224 1,745.516 ↓ 73.3 2,198 1

Nested Loop Left Join (cost=411,258.97..412,080.46 rows=30 width=921) (actual time=1,012.430..1,745.516 rows=2,198 loops=1)

40. 2.059 1,743.292 ↓ 73.3 2,198 1

Nested Loop Left Join (cost=411,258.55..412,066.84 rows=30 width=899) (actual time=1,012.427..1,743.292 rows=2,198 loops=1)

41. 1.513 1,739.035 ↓ 73.3 2,198 1

Nested Loop Left Join (cost=411,258.41..412,061.74 rows=30 width=883) (actual time=1,012.418..1,739.035 rows=2,198 loops=1)

42. 1.213 1,737.522 ↓ 73.3 2,198 1

Hash Left Join (cost=411,258.13..412,052.58 rows=30 width=850) (actual time=1,012.414..1,737.522 rows=2,198 loops=1)

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
43. 1.210 1,736.299 ↓ 73.3 2,198 1

Hash Left Join (cost=411,256.79..412,050.83 rows=30 width=837) (actual time=1,012.395..1,736.299 rows=2,198 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
44. 1.353 1,735.080 ↓ 73.3 2,198 1

Hash Left Join (cost=411,255.23..412,048.86 rows=30 width=821) (actual time=1,012.381..1,735.080 rows=2,198 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
45. 1.373 1,733.711 ↓ 73.3 2,198 1

Nested Loop Left Join (cost=411,253.67..412,046.88 rows=30 width=805) (actual time=1,012.355..1,733.711 rows=2,198 loops=1)

46. 2.319 1,732.338 ↓ 73.3 2,198 1

Nested Loop Left Join (cost=411,253.39..412,037.81 rows=30 width=762) (actual time=1,012.352..1,732.338 rows=2,198 loops=1)

47. 0.587 1,727.821 ↓ 73.3 2,198 1

Nested Loop Left Join (cost=411,253.12..412,028.73 rows=30 width=744) (actual time=1,012.346..1,727.821 rows=2,198 loops=1)

48. 0.935 1,722.838 ↓ 73.3 2,198 1

Nested Loop Left Join (cost=411,252.83..412,019.07 rows=30 width=694) (actual time=1,012.339..1,722.838 rows=2,198 loops=1)

49. 1.382 1,715.309 ↓ 73.3 2,198 1

Nested Loop Left Join (cost=411,252.41..412,004.90 rows=30 width=641) (actual time=1,012.332..1,715.309 rows=2,198 loops=1)

50. 23.892 1,707.333 ↓ 73.3 2,198 1

GroupAggregate (cost=411,251.98..411,750.95 rows=30 width=217) (actual time=1,012.320..1,707.333 rows=2,198 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
51. 11.419 1,013.931 ↓ 495.9 14,878 1

Sort (cost=411,251.98..411,252.05 rows=30 width=110) (actual time=1,011.740..1,013.931 rows=14,878 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 2477kB
52. 3.757 1,002.512 ↓ 495.9 14,878 1

Subquery Scan on produtosinterno (cost=7,478.02..411,251.24 rows=30 width=110) (actual time=115.223..1,002.512 rows=14,878 loops=1)

53. 68.101 998.755 ↓ 495.9 14,878 1

Nested Loop Left Join (cost=7,478.02..411,250.94 rows=30 width=1,193) (actual time=115.221..998.755 rows=14,878 loops=1)

54. 12.221 528.948 ↓ 495.9 14,878 1

Nested Loop Left Join (cost=7,477.73..410,665.25 rows=30 width=174) (actual time=115.046..528.948 rows=14,878 loops=1)

55. 7.506 486.971 ↓ 495.9 14,878 1

Hash Join (cost=7,477.31..410,600.24 rows=30 width=160) (actual time=115.038..486.971 rows=14,878 loops=1)

  • Hash Cond: (guiaprestador_1.guicompetencia = competenciaprestador_1.id)
56. 14.998 479.419 ↓ 14.3 14,878 1

Nested Loop (cost=7,459.28..410,578.01 rows=1,042 width=168) (actual time=114.981..479.419 rows=14,878 loops=1)

57. 41.464 434.665 ↓ 4.3 14,878 1

Nested Loop (cost=7,458.85..402,988.53 rows=3,476 width=143) (actual time=114.969..434.665 rows=14,878 loops=1)

58. 28.700 226.129 ↓ 8.0 83,536 1

Nested Loop (cost=7,458.41..377,560.20 rows=10,429 width=70) (actual time=113.695..226.129 rows=83,536 loops=1)

59. 18.798 156.499 ↓ 13.7 8,186 1

Hash Join (cost=7,457.98..46,040.61 rows=599 width=16) (actual time=113.671..156.499 rows=8,186 loops=1)

  • Hash Cond: (guiaconvenio_1.guiprotocolo = protocoloconvenio_1.id)
60. 32.410 131.896 ↓ 8.2 135,242 1

Nested Loop (cost=0.70..38,515.72 rows=16,436 width=24) (actual time=0.021..131.896 rows=135,242 loops=1)

61. 0.333 0.333 ↑ 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.008..0.333 rows=23 loops=1)

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

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaconvenio_1 (cost=0.43..1,661.68 rows=794 width=32) (actual time=0.329..4.311 rows=5,880 loops=23)

  • Index Cond: (guicompetencia = competenciaconvenio_1.id)
  • Filter: (guiorigem = 'CONVENIO'::text)
  • Rows Removed by Filter: 6775
63. 1.920 5.805 ↓ 1.0 14,169 1

Hash (cost=7,280.61..7,280.61 rows=14,133 width=8) (actual time=5.805..5.805 rows=14,169 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 682kB
64. 2.891 3.885 ↓ 1.0 14,169 1

Bitmap Heap Scan on fiboprotocolo protocoloconvenio_1 (cost=371.95..7,280.61 rows=14,133 width=8) (actual time=1.058..3.885 rows=14,169 loops=1)

  • Recheck Cond: ((data_pagto >= '2019-04-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-05-01 00:00:00'::timestamp without time zone) AND (data_pagto >= '2019-04-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-05-01 00:00:00'::timestamp without time zone))
  • Heap Blocks: exact=642
65. 0.994 0.994 ↓ 1.0 14,169 1

Bitmap Index Scan on idx_fiboprotocolo_data_pagto_idx (cost=0.00..368.42 rows=14,133 width=0) (actual time=0.994..0.994 rows=14,169 loops=1)

  • Index Cond: ((data_pagto >= '2019-04-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-05-01 00:00:00'::timestamp without time zone) AND (data_pagto >= '2019-04-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-05-01 00:00:00'::timestamp without time zone))
66. 40.930 40.930 ↑ 67.5 10 8,186

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoconvenio (cost=0.44..546.71 rows=675 width=62) (actual time=0.002..0.005 rows=10 loops=8,186)

  • Index Cond: (prodguia = guiaconvenio_1.id)
67. 167.072 167.072 ↓ 0.0 0 83,536

Index Scan using idx_fiboproduto_prodassoc_idx on fiboproduto produtoprestador (cost=0.44..2.43 rows=1 width=81) (actual time=0.002..0.002 rows=0 loops=83,536)

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

Index Scan using fiboguia_pkey on fiboguia guiaprestador_1 (cost=0.43..2.17 rows=1 width=33) (actual time=0.002..0.002 rows=1 loops=14,878)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
70. 0.026 0.041 ↑ 1.0 23 1

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

  • Recheck Cond: (comp_convenio = 'Bradesco'::text)
  • Heap Blocks: exact=11
71. 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 = 'Bradesco'::text)
72. 29.756 29.756 ↑ 1.0 1 14,878

Index Scan using idx_fiborecurso_rec_produto_idx on fiborecurso recursoproduto (cost=0.42..2.16 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=14,878)

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

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=14,878)

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

SubPlan (forNested Loop Left Join)

75. 282.682 401.706 ↑ 1.0 1 14,878

Aggregate (cost=17.48..17.49 rows=1 width=32) (actual time=0.027..0.027 rows=1 loops=14,878)

76. 13.528 119.024 ↑ 1.0 1 14,878

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=98) (actual time=0.007..0.008 rows=1 loops=14,878)

77. 13.528 74.390 ↑ 1.0 1 14,878

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=38) (actual time=0.005..0.005 rows=1 loops=14,878)

78. 29.756 29.756 ↑ 1.0 1 14,878

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=14,878)

  • Index Cond: (id_produto = produtoconvenio.id)
79. 31.106 31.106 ↑ 1.0 1 15,553

Index Scan using fiboglosa_pkey on fiboglosa glosas_1 (cost=0.43..8.45 rows=1 width=46) (actual time=0.002..0.002 rows=1 loops=15,553)

  • Index Cond: (id = glosasproduto.elt)
80. 31.106 31.106 ↑ 1.0 1 15,553

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=15,553)

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

SubPlan (forGroupAggregate)

82. 14.878 669.510 ↑ 1.0 1 14,878

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

83.          

Initplan (forResult)

84. 654.632 654.632 ↓ 0.0 0 14,878

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=14,878)

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

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

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

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

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

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

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

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

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

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

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

Hash (cost=1.25..1.25 rows=25 width=30) (actual time=0.016..0.016 rows=25 loops=1)

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

Seq Scan on fibosituacaoguia situacaoinicialprestador (cost=0.00..1.25 rows=25 width=30) (actual time=0.006..0.008 rows=25 loops=1)

92. 0.006 0.009 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=30) (actual time=0.009..0.009 rows=25 loops=1)

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

Seq Scan on fibosituacaoguia situacaoassociacaoprestador (cost=0.00..1.25 rows=25 width=30) (actual time=0.002..0.003 rows=25 loops=1)

94. 0.003 0.010 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=25) (actual time=0.010..0.010 rows=15 loops=1)

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

Seq Scan on fibostatusguia statusprestadorconciliacao (cost=0.00..1.15 rows=15 width=25) (actual time=0.004..0.007 rows=15 loops=1)

96. 0.000 0.000 ↓ 0.0 0 2,198

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

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

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

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

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

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
99. 0.262 0.286 ↓ 146.6 2,199 1

Sort (cost=1.44..1.48 rows=15 width=25) (actual time=0.052..0.286 rows=2,199 loops=1)

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

Seq Scan on fibostatusguia statusprestadoranalise (cost=0.00..1.15 rows=15 width=25) (actual time=0.022..0.024 rows=15 loops=1)

101. 10.238 12.067 ↑ 8.4 514 1

Sort (cost=849.90..860.70 rows=4,318 width=26) (actual time=11.980..12.067 rows=514 loops=1)

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

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

103. 6.594 6.594 ↑ 1.0 1 2,198

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..8.45 rows=1 width=347) (actual time=0.002..0.003 rows=1 loops=2,198)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoconvenio (cost=0.14..0.16 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=2,198)

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

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

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

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

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

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

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

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

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

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

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

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

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

Index Scan using fiboguia_pkey on fiboguia guiacobrancaoriginal (cost=0.43..0.66 rows=1 width=78) (actual time=0.000..0.000 rows=0 loops=2,198)

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

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

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

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

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
121. 8.675 17.584 ↑ 4.3 104 2,198

Materialize (cost=105.34..150.79 rows=444 width=80) (actual time=0.003..0.008 rows=104 loops=2,198)

122. 0.050 8.909 ↑ 4.3 104 1

Hash Right Join (cost=105.34..148.57 rows=444 width=80) (actual time=5.373..8.909 rows=104 loops=1)

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

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

124. 0.019 0.048 ↑ 1.0 104 1

Hash (cost=4.04..4.04 rows=104 width=24) (actual time=0.048..0.048 rows=104 loops=1)

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

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

126. 0.000 0.000 ↓ 0.0 0 2,198

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

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

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

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

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.005..0.006 rows=1 loops=2,198)

  • 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.198 2.198 ↓ 0.0 0 2,198

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

  • 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.155 0.155 ↑ 1.0 565 1

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

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

Index Only Scan using idx_fiboguia_id_guia_originaria_idx on fiboguia (cost=0.43..8.45 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=2,198)

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

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

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
135. 2.198 6.594 ↑ 1.0 1 2,198

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

136. 2.134 4.396 ↓ 0.0 0 2,198

Nested Loop Left Join (cost=1.00..17.08 rows=1 width=90) (actual time=0.002..0.002 rows=0 loops=2,198)

137. 0.000 2.198 ↓ 0.0 0 2,198

Nested Loop Left Join (cost=0.71..16.76 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=2,198)

138. 2.198 2.198 ↓ 0.0 0 2,198

Index Scan using idx_fiboglosasguia_id_guia_idx on fiboglosasguia glosasguia (cost=0.28..8.30 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=2,198)

  • Index Cond: (id_guia = guiaconvenio.id)
139. 0.096 0.096 ↑ 1.0 1 32

Index Scan using fiboglosa_pkey on fiboglosa glosas (cost=0.43..8.45 rows=1 width=46) (actual time=0.003..0.003 rows=1 loops=32)

  • Index Cond: (id = glosasguia.elt)
140. 0.064 0.064 ↑ 1.0 1 32

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo (cost=0.29..0.31 rows=1 width=68) (actual time=0.002..0.002 rows=1 loops=32)

  • Index Cond: (id = glosas.glo_motivo)
141. 2.198 4.396 ↑ 1.0 1 2,198

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

142. 2.198 2.198 ↓ 0.0 0 2,198

Index Scan using idx_espelhamento_site_convenio_guia_convenio_id_idx on espelhamento_site_convenio esp (cost=0.42..8.44 rows=1 width=15) (actual time=0.001..0.001 rows=0 loops=2,198)

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

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

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

Initplan (forIndex Scan)

145. 2.198 2.198 ↓ 0.0 0 2,198

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

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
146. 2.198 4.396 ↑ 1.0 1 2,198

Aggregate (cost=10.49..10.50 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=2,198)

147. 2.198 2.198 ↓ 0.0 0 2,198

Index Scan using idx_fiboguia_guicobrancaoriginal_idx on fiboguia pagrecurso (cost=0.43..10.49 rows=1 width=6) (actual time=0.001..0.001 rows=0 loops=2,198)

  • Index Cond: (guicobrancaoriginal = guiaprestador.id)
  • Filter: (guisituacaoguia = 'PosAuditoria'::text)
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.002 0.002 ↓ 0.0 0 1

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

Planning time : 33.097 ms
Execution time : 2,369.221 ms