explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jtGq

Settings
# exclusive inclusive rows x rows loops node
1. 0.058 3,968.025 ↓ 1.8 100 1

Limit (cost=431,002.22..431,002.36 rows=55 width=3,094) (actual time=3,967.955..3,968.025 rows=100 loops=1)

2. 7.812 3,967.967 ↓ 1.8 100 1

Sort (cost=431,002.22..431,002.36 rows=55 width=3,094) (actual time=3,967.954..3,967.967 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. 23.277 3,960.155 ↓ 43.7 2,403 1

WindowAgg (cost=425,629.29..431,000.08 rows=55 width=3,094) (actual time=3,950.519..3,960.155 rows=2,403 loops=1)

4. 40.374 3,936.878 ↓ 43.7 2,403 1

Hash Right Join (cost=425,629.29..430,995.54 rows=55 width=2,692) (actual time=3,872.754..3,936.878 rows=2,403 loops=1)

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

Initplan (forHash Right Join)

6. 0.026 0.026 ↑ 1.0 1 1

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

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

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

8. 7.385 3,863.873 ↓ 184.8 2,403 1

Hash (cost=425,524.75..425,524.75 rows=13 width=2,162) (actual time=3,863.873..3,863.873 rows=2,403 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2749kB
9. 1.463 3,856.488 ↓ 184.8 2,403 1

Nested Loop Left Join (cost=424,318.56..425,524.75 rows=13 width=2,162) (actual time=3,676.805..3,856.488 rows=2,403 loops=1)

10. 4.446 3,852.622 ↓ 184.8 2,403 1

Nested Loop Left Join (cost=424,318.41..425,522.47 rows=13 width=2,122) (actual time=3,676.798..3,852.622 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
11. 3.252 3,833.758 ↓ 184.8 2,403 1

Nested Loop Left Join (cost=424,318.12..425,518.11 rows=13 width=2,087) (actual time=3,676.758..3,833.758 rows=2,403 loops=1)

12. 2.508 3,830.506 ↓ 184.8 2,403 1

Nested Loop Left Join (cost=424,317.83..425,513.96 rows=13 width=2,017) (actual time=3,676.736..3,830.506 rows=2,403 loops=1)

13. 23.743 3,827.998 ↓ 184.8 2,403 1

Nested Loop Left Join (cost=424,317.69..425,511.75 rows=13 width=2,001) (actual time=3,676.727..3,827.998 rows=2,403 loops=1)

  • Join Filter: (guiaconvenio.guioperadoraoriginal = operadoraoriginalconvenio.id)
  • Rows Removed by Join Filter: 247509
14. 2.242 3,785.031 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,212.33..425,341.84 rows=3 width=1,929) (actual time=3,670.671..3,785.031 rows=2,403 loops=1)

15. 2.301 3,782.789 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,211.90..425,340.42 rows=3 width=1,912) (actual time=3,670.667..3,782.789 rows=2,403 loops=1)

16. 2.301 3,780.488 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,211.61..425,339.46 rows=3 width=1,889) (actual time=3,670.664..3,780.488 rows=2,403 loops=1)

17. 1.841 3,778.187 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,211.19..425,337.44 rows=3 width=1,820) (actual time=3,670.661..3,778.187 rows=2,403 loops=1)

18. 2.875 3,771.540 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,210.91..425,336.52 rows=3 width=1,816) (actual time=3,670.652..3,771.540 rows=2,403 loops=1)

19. 2.224 3,768.665 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,210.63..425,335.61 rows=3 width=1,783) (actual time=3,670.643..3,768.665 rows=2,403 loops=1)

20. 1.534 3,764.038 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,210.51..425,335.15 rows=3 width=1,719) (actual time=3,670.639..3,764.038 rows=2,403 loops=1)

21. 3.265 3,755.295 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,210.08..425,333.73 rows=3 width=1,685) (actual time=3,670.628..3,755.295 rows=2,403 loops=1)

22. 2.049 3,749.627 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,209.95..425,333.24 rows=3 width=1,653) (actual time=3,670.623..3,749.627 rows=2,403 loops=1)

23. 3.291 3,742.772 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,209.81..425,332.75 rows=3 width=1,621) (actual time=3,670.615..3,742.772 rows=2,403 loops=1)

24. 2.214 3,734.675 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,209.68..425,332.26 rows=3 width=1,589) (actual time=3,670.599..3,734.675 rows=2,403 loops=1)

25. 2.066 3,732.461 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,209.40..425,331.35 rows=3 width=1,546) (actual time=3,670.596..3,732.461 rows=2,403 loops=1)

26. 2.160 3,725.589 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,209.13..425,330.44 rows=3 width=1,528) (actual time=3,670.583..3,725.589 rows=2,403 loops=1)

27. 0.993 3,713.817 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,208.70..425,329.03 rows=3 width=1,496) (actual time=3,670.190..3,713.817 rows=2,403 loops=1)

28. 3.314 3,710.421 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,208.28..425,327.01 rows=3 width=1,498) (actual time=3,670.188..3,710.421 rows=2,403 loops=1)

29. 2.465 3,699.898 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,207.85..425,324.99 rows=3 width=1,474) (actual time=3,670.177..3,699.898 rows=2,403 loops=1)

30. 3.453 3,695.030 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,207.72..425,324.53 rows=3 width=1,410) (actual time=3,670.170..3,695.030 rows=2,403 loops=1)

31. 4.336 3,686.771 ↓ 801.0 2,403 1

Nested Loop Left Join (cost=424,207.30..425,323.11 rows=3 width=1,410) (actual time=3,670.157..3,686.771 rows=2,403 loops=1)

  • Filter: (COALESCE(guiaprestador.guistatusanaliseglosa, guiaconvenio.guistatusanaliseglosa) = ANY ('{ProntaParaAnalise,EmAnalise,Analisada,ComPendencia}'::text[]))
32. 3.828 3,675.226 ↓ 18.8 2,403 1

Merge Left Join (cost=424,206.87..424,240.23 rows=128 width=1,072) (actual time=3,670.124..3,675.226 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. 9.341 3,658.383 ↓ 18.8 2,403 1

Sort (cost=423,356.97..423,357.29 rows=128 width=1,061) (actual time=3,657.373..3,658.383 rows=2,403 loops=1)

  • Sort Key: remessa.rem_numero, competenciaprestador.comp_convenio
  • Sort Method: quicksort Memory: 2537kB
34. 2.417 3,649.042 ↓ 18.8 2,403 1

Merge Left Join (cost=423,351.43..423,352.49 rows=128 width=1,061) (actual time=3,646.045..3,649.042 rows=2,403 loops=1)

  • Merge Cond: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
35. 6.926 3,646.332 ↓ 18.8 2,403 1

Sort (cost=423,349.99..423,350.31 rows=128 width=1,029) (actual time=3,645.990..3,646.332 rows=2,403 loops=1)

  • Sort Key: guiaprestador.guistatusanaliseglosa
  • Sort Method: quicksort Memory: 2537kB
36. 3.767 3,639.406 ↓ 18.8 2,403 1

Hash Right Join (cost=423,305.44..423,345.51 rows=128 width=1,029) (actual time=3,633.480..3,639.406 rows=2,403 loops=1)

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

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

38. 3.912 3,343.435 ↓ 80.1 2,403 1

Hash (cost=423,205.06..423,205.06 rows=30 width=973) (actual time=3,343.435..3,343.435 rows=2,403 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1490kB
39. 1.220 3,339.523 ↓ 80.1 2,403 1

Nested Loop Left Join (cost=422,383.57..423,205.06 rows=30 width=973) (actual time=2,579.302..3,339.523 rows=2,403 loops=1)

40. 2.238 3,335.900 ↓ 80.1 2,403 1

Nested Loop Left Join (cost=422,383.15..423,191.44 rows=30 width=951) (actual time=2,579.299..3,335.900 rows=2,403 loops=1)

41. 1.762 3,331.259 ↓ 80.1 2,403 1

Nested Loop Left Join (cost=422,383.01..423,186.34 rows=30 width=935) (actual time=2,579.292..3,331.259 rows=2,403 loops=1)

42. 1.530 3,329.497 ↓ 80.1 2,403 1

Hash Left Join (cost=422,382.73..423,177.18 rows=30 width=902) (actual time=2,579.289..3,329.497 rows=2,403 loops=1)

  • Hash Cond: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
43. 1.391 3,327.958 ↓ 80.1 2,403 1

Hash Left Join (cost=422,381.39..423,175.43 rows=30 width=870) (actual time=2,579.277..3,327.958 rows=2,403 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguiaassoc = situacaoassociacaoprestador.sitcodigo)
44. 1.570 3,326.557 ↓ 80.1 2,403 1

Hash Left Join (cost=422,379.83..423,173.46 rows=30 width=838) (actual time=2,579.262..3,326.557 rows=2,403 loops=1)

  • Hash Cond: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
45. 1.614 3,324.973 ↓ 80.1 2,403 1

Nested Loop Left Join (cost=422,378.27..423,171.48 rows=30 width=806) (actual time=2,579.237..3,324.973 rows=2,403 loops=1)

46. 2.661 3,323.359 ↓ 80.1 2,403 1

Nested Loop Left Join (cost=422,377.99..423,162.41 rows=30 width=763) (actual time=2,579.234..3,323.359 rows=2,403 loops=1)

47. 1.229 3,318.295 ↓ 80.1 2,403 1

Nested Loop Left Join (cost=422,377.72..423,153.33 rows=30 width=745) (actual time=2,579.227..3,318.295 rows=2,403 loops=1)

48. 1.968 3,312.260 ↓ 80.1 2,403 1

Nested Loop Left Join (cost=422,377.43..423,143.67 rows=30 width=695) (actual time=2,579.219..3,312.260 rows=2,403 loops=1)

49. 1.791 3,295.874 ↓ 80.1 2,403 1

Nested Loop Left Join (cost=422,377.01..423,129.50 rows=30 width=642) (actual time=2,579.209..3,295.874 rows=2,403 loops=1)

50. 20.122 3,286.874 ↓ 80.1 2,403 1

GroupAggregate (cost=422,376.58..422,875.55 rows=30 width=217) (actual time=2,579.198..3,286.874 rows=2,403 loops=1)

  • Group Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
51. 13.987 2,581.490 ↓ 496.6 14,897 1

Sort (cost=422,376.58..422,376.65 rows=30 width=110) (actual time=2,579.106..2,581.490 rows=14,897 loops=1)

  • Sort Key: produtosinterno.idguiaprestador, produtosinterno.idguiaconvenio, produtosinterno.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 2479kB
52. 5.358 2,567.503 ↓ 496.6 14,897 1

Subquery Scan on produtosinterno (cost=7,499.79..422,375.84 rows=30 width=110) (actual time=133.956..2,567.503 rows=14,897 loops=1)

53. 80.374 2,562.145 ↓ 496.6 14,897 1

Nested Loop Left Join (cost=7,499.79..422,375.54 rows=30 width=1,193) (actual time=133.954..2,562.145 rows=14,897 loops=1)

54. 15.900 1,826.303 ↓ 496.6 14,897 1

Nested Loop Left Join (cost=7,499.49..421,789.85 rows=30 width=174) (actual time=132.888..1,826.303 rows=14,897 loops=1)

55. 10.820 1,706.124 ↓ 496.6 14,897 1

Hash Join (cost=7,499.07..421,724.84 rows=30 width=160) (actual time=132.871..1,706.124 rows=14,897 loops=1)

  • Hash Cond: (guiaprestador_1.guicompetencia = competenciaprestador_1.id)
56. 17.196 1,695.258 ↓ 14.1 14,897 1

Nested Loop (cost=7,481.04..421,702.55 rows=1,057 width=168) (actual time=132.812..1,695.258 rows=14,897 loops=1)

57. 29.835 1,633.371 ↓ 4.1 14,897 1

Nested Loop (cost=7,480.61..413,779.01 rows=3,629 width=143) (actual time=132.800..1,633.371 rows=14,897 loops=1)

58. 45.067 794.886 ↓ 8.3 89,850 1

Nested Loop (cost=7,480.18..387,236.45 rows=10,886 width=70) (actual time=130.269..794.886 rows=89,850 loops=1)

59. 24.266 179.279 ↓ 12.3 7,710 1

Hash Join (cost=7,479.74..45,341.26 rows=625 width=16) (actual time=129.570..179.279 rows=7,710 loops=1)

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

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

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

  • Filter: (comp_convenio = 'Bradesco'::text)
  • Rows Removed by Filter: 780
62. 107.364 107.364 ↓ 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.344..4.668 rows=5,880 loops=23)

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

Hash (cost=7,297.72..7,297.72 rows=14,505 width=8) (actual time=12.046..12.046 rows=14,557 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 697kB
64. 4.555 8.518 ↓ 1.0 14,557 1

Bitmap Heap Scan on fiboprotocolo protocoloconvenio_1 (cost=381.62..7,297.72 rows=14,505 width=8) (actual time=4.091..8.518 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
65. 3.963 3.963 ↓ 1.0 14,557 1

Bitmap Index Scan on idx_fiboprotocolo_data_pagto_idx (cost=0.00..378.00 rows=14,505 width=0) (actual time=3.963..3.963 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))
66. 570.540 570.540 ↑ 55.8 12 7,710

Index Scan using idx_fiboproduto_prodguia_idx on fiboproduto produtoconvenio (cost=0.44..540.34 rows=669 width=62) (actual time=0.028..0.074 rows=12 loops=7,710)

  • Index Cond: (prodguia = guiaconvenio_1.id)
67. 808.650 808.650 ↓ 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.009..0.009 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
68. 44.691 44.691 ↑ 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.003..0.003 rows=1 loops=14,897)

  • Index Cond: (id = produtoprestador.prodguia)
  • Filter: ((discriminador <> 'CONVENIO'::text) AND (guiorigem = 'HOSPITAL'::text))
69. 0.006 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.024 0.040 ↑ 1.0 23 1

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

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

  • Index Cond: (comp_convenio = 'Bradesco'::text)
72. 104.279 104.279 ↑ 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.007..0.007 rows=1 loops=14,897)

  • Index Cond: (produtoprestador.id = rec_produto)
73. 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..2.00 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
74.          

SubPlan (forNested Loop Left Join)

75. 417.116 655.468 ↑ 1.0 1 14,897

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

76. 27.982 238.352 ↑ 1.0 1 14,897

Nested Loop Left Join (cost=1.15..17.22 rows=1 width=97) (actual time=0.014..0.016 rows=1 loops=14,897)

77. 8.555 178.764 ↑ 1.0 1 14,897

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=37) (actual time=0.011..0.012 rows=1 loops=14,897)

78. 59.588 59.588 ↑ 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.004..0.004 rows=1 loops=14,897)

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

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

  • Index Cond: (id = glosasproduto.elt)
80. 31.606 31.606 ↑ 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.002..0.002 rows=1 loops=15,803)

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

SubPlan (forGroupAggregate)

82. 14.897 685.262 ↑ 1.0 1 14,897

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

83.          

Initplan (forResult)

84. 670.365 670.365 ↓ 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.045..0.045 rows=0 loops=14,897)

  • Filter: ((entidade_id = produtosinterno.idprodutoprestador) AND (nivel = 'Produto'::text))
  • Rows Removed by Filter: 570
85. 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=434) (actual time=0.002..0.003 rows=1 loops=2,403)

  • Index Cond: (produtosinterno.idguiaprestador = id)
86. 14.418 14.418 ↑ 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.006..0.006 rows=1 loops=2,403)

  • Index Cond: (guiaprestador.guibenefic = id)
87. 4.806 4.806 ↑ 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.002..0.002 rows=1 loops=2,403)

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

  • Index Cond: (guiaprestador.guicompetencia = id)
89. 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)
90. 0.006 0.014 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=64) (actual time=0.014..0.014 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=64) (actual time=0.005..0.008 rows=25 loops=1)

92. 0.006 0.010 ↑ 1.0 25 1

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

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

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

94. 0.004 0.009 ↑ 1.0 15 1

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

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

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

96. 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)
97. 2.403 2.403 ↑ 1.0 1 2,403

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

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

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
99. 0.276 0.293 ↓ 160.3 2,404 1

Sort (cost=1.44..1.48 rows=15 width=64) (actual time=0.048..0.293 rows=2,404 loops=1)

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

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

101. 10.913 13.015 ↑ 3.1 1,371 1

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

  • Sort Key: detalhes_quitacao_rpa.numero_remessa, detalhes_quitacao_rpa.nome_convenio
  • Sort Method: quicksort Memory: 500kB
102. 2.102 2.102 ↑ 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..2.102 rows=4,318 loops=1)

103. 7.209 7.209 ↑ 1.0 1 2,403

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

  • Index Cond: (produtosinterno.idguiaconvenio = id)
104. 4.806 4.806 ↑ 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.002..0.002 rows=1 loops=2,403)

  • Index Cond: (guiaprestador.guiprotocolo = id)
105. 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=72) (actual time=0.001..0.001 rows=1 loops=2,403)

  • Index Cond: (protocoloprestador.hospital = id)
106. 7.209 7.209 ↑ 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.003..0.003 rows=1 loops=2,403)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
107. 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)
108. 9.612 9.612 ↑ 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.004..0.004 rows=1 loops=2,403)

  • Index Cond: (guiaconvenio.guibenefic = id)
109. 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)
110. 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)
111. 4.806 4.806 ↑ 1.0 1 2,403

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

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
112. 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=64) (actual time=0.002..0.002 rows=1 loops=2,403)

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

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

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
114. 7.209 7.209 ↑ 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.002..0.003 rows=1 loops=2,403)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
115. 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=72) (actual time=0.001..0.001 rows=1 loops=2,403)

  • Index Cond: (protocoloconvenio.hospital = id)
116. 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)
117. 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)
118. 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=77) (actual time=0.000..0.000 rows=0 loops=2,403)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
119. 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)
120. 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)
121. 11.906 19.224 ↑ 4.3 104 2,403

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

122. 0.102 7.318 ↑ 4.3 104 1

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

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

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

124. 0.017 0.044 ↑ 1.0 104 1

Hash (cost=4.05..4.05 rows=105 width=24) (actual time=0.044..0.044 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,403

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

  • Index Cond: (guiacobrancaoriginal.guioperadoraoriginal = id)
127. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=2,403)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
128. 14.418 14.418 ↑ 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.006..0.006 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
129. 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)
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.142 0.142 ↑ 1.0 565 1

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

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

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

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
134. 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..8.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
135. 2.403 7.209 ↑ 1.0 1 2,403

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

136. 0.000 4.806 ↓ 0.0 0 2,403

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

137. 2.247 4.806 ↓ 0.0 0 2,403

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

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

  • Index Cond: (id_guia = guiaconvenio.id)
139. 0.156 0.156 ↑ 1.0 1 39

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

  • Index Cond: (id = glosasguia.elt)
140. 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.002..0.003 rows=1 loops=39)

  • Index Cond: (id = glosas.glo_motivo)
141. 0.000 4.806 ↑ 1.0 1 2,403

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

142. 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=16) (actual time=0.002..0.002 rows=0 loops=2,403)

  • Index Cond: (guia_convenio_id = guiaconvenio.id)
143. 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)
144.          

Initplan (forIndex Scan)

145. 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)
146. 0.000 4.806 ↑ 1.0 1 2,403

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

147. 4.806 4.806 ↓ 0.0 0 2,403

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

  • 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.003 0.003 ↓ 0.0 0 1

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

Planning time : 41.120 ms
Execution time : 4,056.228 ms