explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vZIM

Settings
# exclusive inclusive rows x rows loops node
1. 0.044 5,860.182 ↓ 100.0 100 1

Limit (cost=407,769.28..407,769.29 rows=1 width=3,051) (actual time=5,860.130..5,860.182 rows=100 loops=1)

2. 7.353 5,860.138 ↓ 100.0 100 1

Sort (cost=407,769.28..407,769.29 rows=1 width=3,051) (actual time=5,860.129..5,860.138 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. 26.141 5,852.785 ↓ 2,403.0 2,403 1

WindowAgg (cost=407,363.95..407,769.26 rows=1 width=3,051) (actual time=5,843.592..5,852.785 rows=2,403 loops=1)

4. 46.771 5,826.644 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,363.95..407,769.18 rows=1 width=2,649) (actual time=5,451.718..5,826.644 rows=2,403 loops=1)

5.          

Initplan (for Nested Loop Left Join)

6. 0.267 0.267 ↑ 1.0 1 1

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

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

Nested Loop Left Join (cost=407,359.42..407,677.69 rows=1 width=1,875) (actual time=5,449.892..5,743.454 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.834 5,689.905 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,359.13..407,677.35 rows=1 width=1,840) (actual time=5,449.255..5,689.905 rows=2,403 loops=1)

9. 2.450 5,675.056 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,358.84..407,677.03 rows=1 width=1,770) (actual time=5,449.039..5,675.056 rows=2,403 loops=1)

10. 2.338 5,672.606 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,358.70..407,676.86 rows=1 width=1,744) (actual time=5,449.037..5,672.606 rows=2,403 loops=1)

11. 2.394 5,670.268 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,358.28..407,676.39 rows=1 width=1,727) (actual time=5,449.035..5,670.268 rows=2,403 loops=1)

12. 2.643 5,667.874 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,357.99..407,676.07 rows=1 width=1,704) (actual time=5,449.032..5,667.874 rows=2,403 loops=1)

13. 3.761 5,665.231 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,357.56..407,675.39 rows=1 width=1,634) (actual time=5,449.030..5,665.231 rows=2,403 loops=1)

14. 3.484 5,656.664 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,357.28..407,675.09 rows=1 width=1,630) (actual time=5,448.856..5,656.664 rows=2,403 loops=1)

15. 3.122 5,650.777 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,357.14..407,674.92 rows=1 width=1,604) (actual time=5,448.851..5,650.777 rows=2,403 loops=1)

16. 2.827 5,647.655 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,356.86..407,674.61 rows=1 width=1,571) (actual time=5,448.831..5,647.655 rows=2,403 loops=1)

17. 2.091 5,642.425 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,356.74..407,674.46 rows=1 width=1,528) (actual time=5,448.827..5,642.425 rows=2,403 loops=1)

18. 1.297 5,625.916 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,356.32..407,673.99 rows=1 width=1,494) (actual time=5,448.622..5,625.916 rows=2,403 loops=1)

19. 2.280 5,619.813 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,356.18..407,673.83 rows=1 width=1,481) (actual time=5,448.618..5,619.813 rows=2,403 loops=1)

20. 1.619 5,612.727 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,356.05..407,673.66 rows=1 width=1,468) (actual time=5,448.612..5,612.727 rows=2,403 loops=1)

21. 2.316 5,603.899 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,355.91..407,673.50 rows=1 width=1,452) (actual time=5,448.604..5,603.899 rows=2,403 loops=1)

22. 3.118 5,601.583 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,355.63..407,673.19 rows=1 width=1,409) (actual time=5,448.602..5,601.583 rows=2,403 loops=1)

23. 1.886 5,593.659 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,355.36..407,672.89 rows=1 width=1,391) (actual time=5,448.596..5,593.659 rows=2,403 loops=1)

24. 3.409 5,550.922 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,354.94..407,672.42 rows=1 width=1,359) (actual time=5,448.215..5,550.922 rows=2,403 loops=1)

25. 2.909 5,545.110 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,354.51..407,671.75 rows=1 width=1,361) (actual time=5,448.212..5,545.110 rows=2,403 loops=1)

26. 3.153 5,530.186 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,354.08..407,671.07 rows=1 width=1,337) (actual time=5,448.007..5,530.186 rows=2,403 loops=1)

27. 3.541 5,524.630 ↓ 2,403.0 2,403 1

Nested Loop Left Join (cost=407,353.96..407,670.92 rows=1 width=1,294) (actual time=5,447.798..5,524.630 rows=2,403 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
28. 1.581 5,511.477 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=407,353.53..407,425.58 rows=29 width=955) (actual time=5,447.776..5,511.477 rows=2,403 loops=1)

29. 0.735 5,471.448 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=407,353.11..407,411.83 rows=29 width=955) (actual time=5,447.504..5,471.448 rows=2,403 loops=1)

30. 1.211 5,461.101 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=407,352.69..407,398.66 rows=29 width=933) (actual time=5,447.502..5,461.101 rows=2,403 loops=1)

31. 2.078 5,455.084 ↓ 82.9 2,403 1

Nested Loop Left Join (cost=407,352.54..407,393.73 rows=29 width=907) (actual time=5,447.494..5,455.084 rows=2,403 loops=1)

32. 4.223 5,453.006 ↓ 82.9 2,403 1

Merge Left Join (cost=407,352.27..407,384.88 rows=29 width=874) (actual time=5,447.490..5,453.006 rows=2,403 loops=1)

  • Merge Cond: ((remessa.rem_numero = detalhes_quitacao_rpa.numero_remessa) AND (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio))
33. 7.587 5,433.111 ↓ 82.9 2,403 1

Sort (cost=406,502.36..406,502.44 rows=29 width=863) (actual time=5,432.056..5,433.111 rows=2,403 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 2537kB
34. 1.670 5,425.524 ↓ 82.9 2,403 1

Merge Left Join (cost=406,501.38..406,501.66 rows=29 width=863) (actual time=5,423.367..5,425.524 rows=2,403 loops=1)

  • Merge Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
35. 6.355 5,423.655 ↓ 82.9 2,403 1

Sort (cost=406,499.94..406,500.01 rows=29 width=850) (actual time=5,423.335..5,423.655 rows=2,403 loops=1)

  • Sort Key: guiaprestador.guistatusanaliseglosa
  • Sort Method: quicksort Memory: 2537kB
36. 1.784 5,417.300 ↓ 82.9 2,403 1

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

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
37. 1.648 5,415.508 ↓ 82.9 2,403 1

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

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
38. 2.319 5,413.845 ↓ 82.9 2,403 1

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

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
39. 2.081 5,411.509 ↓ 82.9 2,403 1

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

40. 1.538 5,409.428 ↓ 82.9 2,403 1

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

41. 3.417 5,403.084 ↓ 82.9 2,403 1

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

42. 1.866 5,382.846 ↓ 82.9 2,403 1

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

43. 3.894 5,222.382 ↓ 82.9 2,403 1

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

44. 31.988 5,211.279 ↓ 82.9 2,403 1

GroupAggregate (cost=405,725.16..406,207.51 rows=29 width=217) (actual time=4,476.754..5,211.279 rows=2,403 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
45. 15.353 4,479.132 ↓ 513.7 14,897 1

Sort (cost=405,725.16..405,725.24 rows=29 width=110) (actual time=4,475.958..4,479.132 rows=14,897 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 2479kB
46. 5.701 4,463.779 ↓ 513.7 14,897 1

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

47. 97.019 4,458.078 ↓ 513.7 14,897 1

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

48. 11.175 3,601.312 ↓ 513.7 14,897 1

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

49. 11.533 3,456.064 ↓ 513.7 14,897 1

Hash Join (cost=7,467.04..405,119.93 rows=29 width=160) (actual time=1,572.252..3,456.064 rows=14,897 loops=1)

  • Hash Cond: (guiaprestador_1.guicompetencia = competenciaprestador_1.id)
50. 11.362 3,442.759 ↓ 14.5 14,897 1

Nested Loop (cost=7,449.01..405,097.77 rows=1,026 width=168) (actual time=1,570.466..3,442.759 rows=14,897 loops=1)

51. 11.515 3,342.015 ↓ 4.4 14,897 1

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

52. 45.587 2,432.000 ↓ 8.7 89,850 1

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

53. 42.184 1,761.903 ↓ 13.1 7,710 1

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

  • Hash Cond: (guiaconvenio_1.guiprotocolo = protocoloconvenio_1.id)
54. 49.746 1,627.288 ↓ 8.2 135,242 1

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

55. 0.731 0.731 ↑ 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.014..0.731 rows=23 loops=1)

  • Filter: (comp_convenio = 'Bradesco'::text)
  • Rows Removed by Filter: 780
56. 1,576.811 1,576.811 ↓ 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=4.905..68.557 rows=5,880 loops=23)

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

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

  • Buckets: 16384 Batches: 1 Memory Usage: 697kB
58. 83.983 87.507 ↓ 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.887..87.507 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
59. 3.524 3.524 ↓ 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.524..3.524 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))
60. 624.510 624.510 ↑ 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.031..0.081 rows=12 loops=7,710)

  • Index Cond: (prodguia = guiaconvenio_1.id)
61. 898.500 898.500 ↓ 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.010..0.010 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
62. 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))
63. 0.016 1.772 ↑ 1.0 23 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
64. 1.652 1.756 ↑ 1.0 23 1

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

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

  • Index Cond: (comp_convenio = 'Bradesco'::text)
66. 134.073 134.073 ↑ 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.009..0.009 rows=1 loops=14,897)

  • Index Cond: (produtoprestador.id = rec_produto)
67. 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
68.          

SubPlan (for Nested Loop Left Join)

69. 461.807 759.747 ↑ 1.0 1 14,897

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

70. 27.076 297.940 ↑ 1.0 1 14,897

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

71. 7.649 223.455 ↑ 1.0 1 14,897

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

72. 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)
73. 126.424 126.424 ↑ 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.008..0.008 rows=1 loops=15,803)

  • Index Cond: (id = glosasproduto.elt)
74. 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)
75.          

SubPlan (for GroupAggregate)

76. 14.897 700.159 ↑ 1.0 1 14,897

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

77.          

Initplan (for Result)

78. 685.262 685.262 ↓ 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.046..0.046 rows=0 loops=14,897)

  • Filter: ((entidade_id = produtosinterno.idprodutoprestador) AND (nivel = 'Produto'::text))
  • Rows Removed by Filter: 570
79. 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)
80. 158.598 158.598 ↑ 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.066..0.066 rows=1 loops=2,403)

  • Index Cond: (guiaprestador.guibenefic = id)
81. 16.821 16.821 ↑ 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.007..0.007 rows=1 loops=2,403)

  • Index Cond: (guiaprestador.guiremessa = id)
82. 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)
83. 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)
84. 0.008 0.017 ↑ 1.0 25 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
85. 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.006..0.009 rows=25 loops=1)

86. 0.005 0.015 ↑ 1.0 25 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
87. 0.010 0.010 ↑ 1.0 25 1

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

88. 0.003 0.008 ↑ 1.0 15 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
89. 0.005 0.005 ↑ 1.0 15 1

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

90. 0.192 0.199 ↓ 160.3 2,404 1

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

  • Sort Key: statusprestadoranalise.stcodigo
  • Sort Method: quicksort Memory: 26kB
91. 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)

92. 9.813 15.672 ↑ 3.1 1,371 1

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

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

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

94. 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)
95. 4.806 4.806 ↑ 1.0 1 2,403

Index Scan using idx_view_smartdata_operadoras_operadora_id_idx on view_smartdata_operadoras operadoraoriginalprestador (cost=0.14..0.16 rows=1 width=34) (actual time=0.001..0.002 rows=1 loops=2,403)

  • Index Cond: (guiaprestador.guioperadoraoriginal = operadora_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.003..0.004 rows=0 loops=2,403)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
97. 38.448 38.448 ↑ 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.015..0.016 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.003..0.004 rows=1 loops=2,403)

  • Index Cond: (produtosinterno.idguiaconvenio = id)
99. 2.403 2.403 ↑ 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.001..0.001 rows=1 loops=2,403)

  • Index Cond: (protocoloprestador.hospital = id)
100. 12.015 12.015 ↑ 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.005..0.005 rows=1 loops=2,403)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
101. 2.403 2.403 ↓ 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.001 rows=0 loops=2,403)

  • Index Cond: (id = guiarecurso.guiguiaassoc)
102. 40.851 40.851 ↑ 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.016..0.017 rows=1 loops=2,403)

  • Index Cond: (guiaconvenio.guibenefic = id)
103. 4.806 4.806 ↑ 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.002 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.002..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. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=2,403)

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

Index Scan using idx_view_smartdata_operadoras_operadora_id_idx on view_smartdata_operadoras operadoraoriginalconvenio (cost=0.14..0.16 rows=1 width=34) (actual time=0.001..0.001 rows=1 loops=2,403)

  • Index Cond: (guiaconvenio.guioperadoraoriginal = operadora_id)
112. 4.806 4.806 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaconvenio.recebimento_id = id)
113. 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)
114. 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)
115. 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)
116. 0.000 0.000 ↓ 0.0 0 2,403

Index Scan using idx_view_smartdata_operadoras_operadora_id_idx on view_smartdata_operadoras operadoraoriginalcobrancaoriginal (cost=0.14..0.16 rows=1 width=34) (actual time=0.000..0.000 rows=0 loops=2,403)

  • Index Cond: (guiacobrancaoriginal.guioperadoraoriginal = operadora_id)
117. 12.015 12.015 ↓ 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.005..0.005 rows=0 loops=2,403)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
118. 48.060 48.060 ↑ 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.020..0.020 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
119. 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)
120.          

SubPlan (for Nested Loop Left Join)

121. 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))
122. 0.107 0.107 ↑ 1.0 565 1

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

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
123. 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
124. 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
125. 2.403 9.612 ↑ 1.0 1 2,403

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

126. 2.286 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)

127. 0.000 4.806 ↓ 0.0 0 2,403

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

128. 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)
129. 0.195 0.195 ↑ 1.0 1 39

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

  • Index Cond: (id = glosasguia.elt)
130. 0.117 0.117 ↑ 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.003 rows=1 loops=39)

  • Index Cond: (id = glosas.glo_motivo)
131. 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)

132. 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)
133. 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)
134.          

Initplan (for Index Scan)

135. 2.403 2.403 ↓ 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.001..0.001 rows=0 loops=2,403)

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
136. 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)

137. 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)
138. 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
139. 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 : 201.519 ms
Execution time : 5,931.206 ms