explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bmQD

Settings
# exclusive inclusive rows x rows loops node
1. 0.068 7,331.805 ↓ 100.0 100 1

Limit (cost=407,782.50..407,782.51 rows=1 width=3,051) (actual time=7,331.715..7,331.805 rows=100 loops=1)

2. 8.340 7,331.737 ↓ 100.0 100 1

Sort (cost=407,782.50..407,782.51 rows=1 width=3,051) (actual time=7,331.713..7,331.737 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. 31.987 7,323.397 ↓ 2,403.0 2,403 1

WindowAgg (cost=407,370.47..407,782.48 rows=1 width=3,051) (actual time=7,312.650..7,323.397 rows=2,403 loops=1)

4. 63.740 7,291.410 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,370.47..407,782.40 rows=1 width=2,649) (actual time=6,790.910..7,291.410 rows=2,403 loops=1)

5.          

Initplan (for Nested Loop Left Join)

6. 0.025 0.025 ↑ 1.0 1 1

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

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
  • Rows Removed by Filter: 91
7. 6.210 7,189.076 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,365.94..407,690.91 rows=1 width=1,875) (actual time=6,788.658..7,189.076 rows=2,403 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: 6
8. 2.371 7,127.597 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,365.65..407,690.57 rows=1 width=1,840) (actual time=6,787.850..7,127.597 rows=2,403 loops=1)

9. 2.630 7,110.808 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,365.36..407,690.25 rows=1 width=1,770) (actual time=6,787.436..7,110.808 rows=2,403 loops=1)

10. 3.051 7,108.178 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,364.94..407,689.78 rows=1 width=1,753) (actual time=6,787.434..7,108.178 rows=2,403 loops=1)

11. 3.764 7,105.127 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,364.65..407,689.46 rows=1 width=1,730) (actual time=6,787.431..7,105.127 rows=2,403 loops=1)

12. 36.074 7,094.154 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,364.37..407,689.15 rows=1 width=1,726) (actual time=6,787.064..7,094.154 rows=2,403 loops=1)

  • Join Filter: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.operadora_id)
  • Rows Removed by Join Filter: 247509
13. 4.191 7,031.647 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,364.37..407,682.81 rows=1 width=1,700) (actual time=6,787.033..7,031.647 rows=2,403 loops=1)

14. 1.541 7,017.844 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,363.70..407,676.69 rows=1 width=1,604) (actual time=6,787.017..7,017.844 rows=2,403 loops=1)

15. 3.918 7,013.900 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,363.42..407,676.38 rows=1 width=1,571) (actual time=6,786.825..7,013.900 rows=2,403 loops=1)

16. 4.022 7,007.579 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,363.30..407,676.23 rows=1 width=1,528) (actual time=6,786.820..7,007.579 rows=2,403 loops=1)

17. 2.211 6,989.139 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,362.87..407,675.76 rows=1 width=1,494) (actual time=6,786.618..6,989.139 rows=2,403 loops=1)

18. 3.461 6,982.122 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,362.74..407,675.59 rows=1 width=1,481) (actual time=6,786.613..6,982.122 rows=2,403 loops=1)

19. 3.167 6,973.855 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,362.60..407,675.43 rows=1 width=1,468) (actual time=6,786.606..6,973.855 rows=2,403 loops=1)

20. 2.879 6,963.479 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,362.47..407,675.27 rows=1 width=1,452) (actual time=6,786.597..6,963.479 rows=2,403 loops=1)

21. 2.426 6,960.600 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,362.19..407,674.96 rows=1 width=1,409) (actual time=6,786.594..6,960.600 rows=2,403 loops=1)

22. 2.354 6,950.965 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,361.92..407,674.66 rows=1 width=1,391) (actual time=6,786.586..6,950.965 rows=2,403 loops=1)

23. 1.548 6,905.357 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,361.49..407,674.19 rows=1 width=1,359) (actual time=6,786.186..6,905.357 rows=2,403 loops=1)

24. 2.947 6,899.003 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,361.07..407,673.52 rows=1 width=1,361) (actual time=6,786.183..6,899.003 rows=2,403 loops=1)

25. 2.902 6,874.429 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,360.64..407,672.84 rows=1 width=1,337) (actual time=6,785.971..6,874.429 rows=2,403 loops=1)

26. 5.778 6,866.721 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,360.51..407,672.69 rows=1 width=1,294) (actual time=6,784.976..6,866.721 rows=2,403 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
27. 2.509 6,851.331 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=407,360.09..407,427.35 rows=29 width=955) (actual time=6,784.950..6,851.331 rows=2,403 loops=1)

28. 1.906 6,805.568 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=407,359.66..407,413.60 rows=29 width=955) (actual time=6,784.518..6,805.568 rows=2,403 loops=1)

29. 2.586 6,794.050 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=407,359.24..407,400.43 rows=29 width=933) (actual time=6,784.516..6,794.050 rows=2,403 loops=1)

30. 5.276 6,791.464 ↓ 82.9 2,403 1

Merge Left Join (cost=407,358.97..407,391.58 rows=29 width=900) (actual time=6,784.510..6,791.464 rows=2,403 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
31. 8.563 6,769.675 ↓ 82.9 2,403 1

Sort (cost=406,509.06..406,509.13 rows=29 width=889) (actual time=6,768.296..6,769.675 rows=2,403 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 2537kB
32. 1.930 6,761.112 ↓ 82.9 2,403 1

Merge Left Join (cost=406,508.08..406,508.36 rows=29 width=889) (actual time=6,758.674..6,761.112 rows=2,403 loops=1)

  • Merge Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
33. 6.640 6,759.019 ↓ 82.9 2,403 1

Sort (cost=406,506.63..406,506.71 rows=29 width=876) (actual time=6,758.637..6,759.019 rows=2,403 loops=1)

  • Sort Key: guiaprestador.guistatusanaliseglosa
  • Sort Method: quicksort Memory: 2537kB
34. 1.897 6,752.379 ↓ 82.9 2,403 1

Hash Left Join (cost=405,737.66..406,505.93 rows=29 width=876) (actual time=5,773.825..6,752.379 rows=2,403 loops=1)

  • Hash Cond: (guiaprestador.guioperadoraoriginal = operadoraoriginalprestador.operadora_id)
35. 1.784 6,750.399 ↓ 82.9 2,403 1

Hash Left Join (cost=405,731.32..406,499.23 rows=29 width=850) (actual time=5,773.735..6,750.399 rows=2,403 loops=1)

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
36. 1.730 6,748.605 ↓ 82.9 2,403 1

Hash Left Join (cost=405,729.98..406,497.49 rows=29 width=837) (actual time=5,773.720..6,748.605 rows=2,403 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
37. 2.312 6,746.863 ↓ 82.9 2,403 1

Hash Left Join (cost=405,728.42..406,495.53 rows=29 width=821) (actual time=5,773.701..6,746.863 rows=2,403 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
38. 2.214 6,744.528 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=405,726.85..406,493.57 rows=29 width=805) (actual time=5,773.664..6,744.528 rows=2,403 loops=1)

39. 2.000 6,742.314 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=405,726.58..406,484.80 rows=29 width=762) (actual time=5,773.661..6,742.314 rows=2,403 loops=1)

40. 2.915 6,735.508 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=405,726.30..406,476.02 rows=29 width=744) (actual time=5,773.649..6,735.508 rows=2,403 loops=1)

41. 3.212 6,713.369 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=405,726.01..406,466.69 rows=29 width=694) (actual time=5,773.203..6,713.369 rows=2,403 loops=1)

42. 4.469 6,522.723 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=405,725.59..406,452.99 rows=29 width=641) (actual time=5,772.538..6,522.723 rows=2,403 loops=1)

43. 21.130 6,511.045 ↓ 82.9 2,403 1

GroupAggregate (cost=405,725.16..406,207.51 rows=29 width=217) (actual time=5,772.522..6,511.045 rows=2,403 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
44. 15.943 5,774.859 ↓ 513.7 14,897 1

Sort (cost=405,725.16..405,725.24 rows=29 width=110) (actual time=5,771.779..5,774.859 rows=14,897 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 2479kB
45. 6.530 5,758.916 ↓ 513.7 14,897 1

Subquery Scan on produtosinterno (cost=7,467.76..405,724.46 rows=29 width=110) (actual time=1,767.937..5,758.916 rows=14,897 loops=1)

46. 106.679 5,752.386 ↓ 513.7 14,897 1

Nested Loop Left Join (cost=7,467.76..405,724.17 rows=29 width=1,193) (actual time=1,767.936..5,752.386 rows=14,897 loops=1)

47. 10.500 4,439.050 ↓ 513.7 14,897 1

Nested Loop Left Join (cost=7,467.47..405,182.77 rows=29 width=174) (actual time=1,764.210..4,439.050 rows=14,897 loops=1)

48. 11.965 4,279.580 ↓ 513.7 14,897 1

Hash Join (cost=7,467.04..405,119.93 rows=29 width=160) (actual time=1,754.095..4,279.580 rows=14,897 loops=1)

  • Hash Cond: (guiaprestador_1.guicompetencia = competenciaprestador_1.id)
49. 10.955 4,265.547 ↓ 14.5 14,897 1

Nested Loop (cost=7,449.01..405,097.77 rows=1,026 width=168) (actual time=1,752.007..4,265.547 rows=14,897 loops=1)

50. 77.137 4,165.210 ↓ 4.4 14,897 1

Nested Loop (cost=7,448.58..397,624.01 rows=3,423 width=143) (actual time=1,751.573..4,165.210 rows=14,897 loops=1)

51. 42.368 2,830.173 ↓ 8.7 89,850 1

Nested Loop (cost=7,448.15..372,580.98 rows=10,271 width=70) (actual time=1,748.435..2,830.173 rows=89,850 loops=1)

52. 44.502 1,955.125 ↓ 13.1 7,710 1

Hash Join (cost=7,447.71..46,043.71 rows=590 width=16) (actual time=1,746.013..1,955.125 rows=7,710 loops=1)

  • Hash Cond: (guiaconvenio_1.guiprotocolo = protocoloconvenio_1.id)
53. 49.445 1,796.153 ↓ 8.2 135,242 1

Nested Loop (cost=0.70..38,529.13 rows=16,445 width=24) (actual time=0.395..1,796.153 rows=135,242 loops=1)

54. 0.962 0.962 ↑ 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.012..0.962 rows=23 loops=1)

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

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

  • Index Cond: (guicompetencia = competenciaconvenio_1.id)
  • Filter: (guiorigem = 'CONVENIO'::text)
  • Rows Removed by Filter: 6775
56. 6.112 114.470 ↓ 1.0 14,557 1

Hash (cost=7,273.03..7,273.03 rows=13,918 width=8) (actual time=114.470..114.470 rows=14,557 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 697kB
57. 105.304 108.358 ↓ 1.0 14,557 1

Bitmap Heap Scan on fiboprotocolo protocoloconvenio_1 (cost=368.67..7,273.03 rows=13,918 width=8) (actual time=3.760..108.358 rows=14,557 loops=1)

  • Recheck Cond: ((data_pagto >= '2019-05-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-05-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-06-01 00:00:00'::timestamp without time zone))
  • Heap Blocks: exact=474
58. 3.054 3.054 ↓ 1.0 14,557 1

Bitmap Index Scan on idx_fiboprotocolo_data_pagto_idx (cost=0.00..365.19 rows=13,918 width=0) (actual time=3.054..3.054 rows=14,557 loops=1)

  • Index Cond: ((data_pagto >= '2019-05-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-05-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-06-01 00:00:00'::timestamp without time zone))
59. 832.680 832.680 ↑ 56.2 12 7,710

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoconvenio (cost=0.44..546.70 rows=675 width=62) (actual time=0.040..0.108 rows=12 loops=7,710)

  • Index Cond: (prodguia = guiaconvenio_1.id)
60. 1,257.900 1,257.900 ↓ 0.0 0 89,850

Index Scan using idx_fiboproduto_prodassoc_idx on fiboproduto produtoprestador (cost=0.44..2.43 rows=1 width=81) (actual time=0.014..0.014 rows=0 loops=89,850)

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

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
63. 1.601 2.059 ↑ 1.0 23 1

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

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

  • Index Cond: (comp_convenio = 'Bradesco'::text)
65. 148.970 148.970 ↑ 1.0 1 14,897

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

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

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

  • Index Cond: (id = produtoprestador.registro_envio_recurso_id)
  • Heap Fetches: 0
67.          

SubPlan (for Nested Loop Left Join)

68. 461.807 1,206.657 ↑ 1.0 1 14,897

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

69. 12.179 744.850 ↑ 1.0 1 14,897

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=98) (actual time=0.048..0.050 rows=1 loops=14,897)

70. 11.169 685.262 ↑ 1.0 1 14,897

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

71. 89.382 89.382 ↑ 1.0 1 14,897

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.006 rows=1 loops=14,897)

  • Index Cond: (id_produto = produtoconvenio.id)
72. 584.711 584.711 ↑ 1.0 1 15,803

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

  • Index Cond: (id = glosasproduto.elt)
73. 47.409 47.409 ↑ 1.0 1 15,803

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

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

SubPlan (for GroupAggregate)

75. 14.897 715.056 ↑ 1.0 1 14,897

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

76.          

Initplan (for Result)

77. 700.159 700.159 ↓ 0.0 0 14,897

Seq Scan on anexo_recurso anexo_recurso_2 (cost=0.00..16.55 rows=1 width=0) (actual time=0.047..0.047 rows=0 loops=14,897)

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

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

  • Index Cond: (produtosinterno.idguiaprestador = id)
79. 187.434 187.434 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaprestador.guibenefic = id)
80. 19.224 19.224 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaprestador.guiremessa = id)
81. 4.806 4.806 ↑ 1.0 1 2,403

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

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

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

  • Index Cond: (guiaprestador.guimotglosa = id)
83. 0.014 0.023 ↑ 1.0 25 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
84. 0.009 0.009 ↑ 1.0 25 1

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

85. 0.004 0.012 ↑ 1.0 25 1

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

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

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

87. 0.004 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
88. 0.006 0.006 ↑ 1.0 15 1

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

89. 0.021 0.083 ↑ 1.0 104 1

Hash (cost=5.04..5.04 rows=104 width=34) (actual time=0.083..0.083 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
90. 0.062 0.062 ↑ 1.0 104 1

Seq Scan on view_smartdata_operadoras operadoraoriginalprestador (cost=0.00..5.04 rows=104 width=34) (actual time=0.020..0.062 rows=104 loops=1)

91. 0.156 0.163 ↓ 160.3 2,404 1

Sort (cost=1.44..1.48 rows=15 width=25) (actual time=0.031..0.163 rows=2,404 loops=1)

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

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

93. 10.442 16.513 ↑ 3.1 1,371 1

Sort (cost=849.90..860.70 rows=4,318 width=26) (actual time=16.206..16.513 rows=1,371 loops=1)

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

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

95. 0.000 0.000 ↓ 0.0 0 2,403

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

  • Index Cond: (guiaprestador.guiprestoriginal = id)
96. 9.612 9.612 ↓ 0.0 0 2,403

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

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
97. 43.254 43.254 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaprestador.guiprotocolo = id)
98. 9.612 9.612 ↑ 1.0 1 2,403

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

  • Index Cond: (produtosinterno.idguiaconvenio = id)
99. 4.806 4.806 ↑ 1.0 1 2,403

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

  • Index Cond: (protocoloprestador.hospital = id)
100. 21.627 21.627 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
101. 4.806 4.806 ↓ 0.0 0 2,403

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

  • Index Cond: (id = guiarecurso.guiguiaassoc)
102. 43.254 43.254 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaconvenio.guibenefic = id)
103. 7.209 7.209 ↑ 1.0 1 2,403

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

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

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

  • Index Cond: (guiaconvenio.guimotglosa = id)
105. 7.209 7.209 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
106. 4.806 4.806 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaconvenio.guistatusconciliacao = stcodigo)
107. 4.806 4.806 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
108. 14.418 14.418 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaconvenio.guiprotocolo = id)
109. 2.403 2.403 ↑ 1.0 1 2,403

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

  • Index Cond: (protocoloconvenio.hospital = id)
110. 2.403 2.403 ↓ 0.0 0 2,403

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

  • Index Cond: (guiaconvenio.guiprestoriginal = id)
111. 7.209 9.612 ↓ 0.0 0 2,403

Hash Right Join (cost=0.68..6.12 rows=1 width=104) (actual time=0.004..0.004 rows=0 loops=2,403)

  • Hash Cond: (operadoraoriginalcobrancaoriginal.operadora_id = guiacobrancaoriginal.guioperadoraoriginal)
112. 0.000 0.000 ↓ 0.0 0

Seq Scan on view_smartdata_operadoras operadoraoriginalcobrancaoriginal (cost=0.00..5.04 rows=104 width=34) (never executed)

113. 2.403 2.403 ↓ 0.0 0 2,403

Hash (cost=0.66..0.66 rows=1 width=78) (actual time=0.001..0.001 rows=0 loops=2,403)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
114. 0.000 0.000 ↓ 0.0 0 2,403

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

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
115. 26.433 26.433 ↑ 1.0 104 2,403

Seq Scan on view_smartdata_operadoras operadoraoriginalconvenio (cost=0.00..5.04 rows=104 width=34) (actual time=0.002..0.011 rows=104 loops=2,403)

116. 7.209 7.209 ↑ 1.0 1 2,403

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

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

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

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

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

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
119. 14.418 14.418 ↓ 0.0 0 2,403

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

  • Index Cond: (guiaprestador.id_lote_recurso = id)
120. 55.269 55.269 ↑ 1.0 1 2,403

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.023..0.023 rows=1 loops=2,403)

  • 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. 2.403 2.403 ↓ 0.0 0 2,403

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

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

SubPlan (for Nested Loop Left 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.121 0.121 ↑ 1.0 565 1

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

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
125. 4.806 4.806 ↓ 0.0 0 2,403

Index Only Scan using idx_fiboguia_id_guia_originaria_idx on fiboguia (cost=0.43..4.45 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=2,403)

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
126. 2.403 2.403 ↓ 0.0 0 2,403

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

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
127. 4.806 12.015 ↑ 1.0 1 2,403

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

128. 0.000 7.209 ↓ 0.0 0 2,403

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

129. 2.169 7.209 ↓ 0.0 0 2,403

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

130. 4.806 4.806 ↓ 0.0 0 2,403

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

  • Index Cond: (id_guia = guiaconvenio.id)
131. 0.234 0.234 ↑ 1.0 1 39

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

  • Index Cond: (id = glosasguia.elt)
132. 0.156 0.156 ↑ 1.0 1 39

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

  • Index Cond: (id = glosas.glo_motivo)
133. 2.403 7.209 ↑ 1.0 1 2,403

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

134. 4.806 4.806 ↓ 0.0 0 2,403

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.002..0.002 rows=0 loops=2,403)

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

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

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

Initplan (for Index Scan)

137. 4.806 4.806 ↓ 0.0 0 2,403

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

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
138. 0.000 7.209 ↑ 1.0 1 2,403

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

139. 7.209 7.209 ↓ 0.0 0 2,403

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

  • Index Cond: (guicobrancaoriginal = guiaprestador.id)
  • Filter: (guisituacaoguia = 'PosAuditoria'::text)
140. 2.403 2.403 ↓ 0.0 0 2,403

Index Only Scan using idx_devolucao_guia_guia_devolvida_id_idx on devolucao_guia devolucao (cost=0.14..8.16 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=2,403)

  • Index Cond: (guia_devolvida_id = guiaprestador.id)
  • Heap Fetches: 0
141. 0.000 0.000 ↓ 0.0 0

Seq Scan on devolucao_guia devolucao_1 (cost=0.00..11.50 rows=150 width=8) (never executed)

Planning time : 130.420 ms
Execution time : 7,402.634 ms