explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WC2q

Settings
# exclusive inclusive rows x rows loops node
1. 0.061 897.700 ↑ 1.0 100 1

Limit (cost=66,488.44..66,488.69 rows=100 width=3,076) (actual time=897.620..897.700 rows=100 loops=1)

2. 5.918 897.639 ↑ 2.4 100 1

Sort (cost=66,488.44..66,489.02 rows=235 width=3,076) (actual time=897.619..897.639 rows=100 loops=1)

  • Sort Key: (sum(geral.diferenca) OVER (?)), geral.protocolo_ultimo_pagamento, geral.diferenca
  • Sort Method: top-N heapsort Memory: 127kB
3. 3.573 891.721 ↓ 6.7 1,571 1

WindowAgg (cost=66,475.34..66,479.45 rows=235 width=3,076) (actual time=887.981..891.721 rows=1,571 loops=1)

4. 5.973 888.148 ↓ 6.7 1,571 1

Sort (cost=66,475.34..66,475.93 rows=235 width=3,044) (actual time=887.968..888.148 rows=1,571 loops=1)

  • Sort Key: geral.protocolo_ultimo_pagamento
  • Sort Method: quicksort Memory: 1671kB
5. 0.607 882.175 ↓ 6.7 1,571 1

Subquery Scan on geral (cost=324.08..66,466.09 rows=235 width=3,044) (actual time=876.803..882.175 rows=1,571 loops=1)

6. 13.590 881.568 ↓ 6.7 1,571 1

WindowAgg (cost=324.08..66,463.74 rows=235 width=3,044) (actual time=876.792..881.568 rows=1,571 loops=1)

7. 36.118 867.978 ↓ 6.7 1,571 1

Nested Loop Left Join (cost=324.08..66,444.35 rows=235 width=2,642) (actual time=253.384..867.978 rows=1,571 loops=1)

  • Join Filter: (guiacobrancaoriginal.guioperadoraoriginal = operadoraoriginalcobrancaoriginal.id)
  • Rows Removed by Join Filter: 163384
8.          

Initplan (forNested Loop Left Join)

9. 0.000 0.000 ↓ 0.0 0

Seq Scan on fibocamposconfig (cost=0.00..4.38 rows=1 width=1) (never executed)

  • Filter: ((cc_tipo = 'HOSPITAL'::text) AND (ccnome = 'permitirAceiteComProdutoRecursado'::text))
10. 0.865 804.948 ↓ 28.6 1,571 1

Nested Loop Left Join (cost=214.34..43,158.41 rows=55 width=1,978) (actual time=243.635..804.948 rows=1,571 loops=1)

11. 1.658 802.512 ↓ 28.6 1,571 1

Nested Loop Left Join (cost=214.19..43,148.78 rows=55 width=1,938) (actual time=243.629..802.512 rows=1,571 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: 1
12. 2.559 789.864 ↓ 28.5 1,570 1

Nested Loop Left Join (cost=213.90..43,130.31 rows=55 width=1,903) (actual time=243.603..789.864 rows=1,570 loops=1)

13. 1.426 784.165 ↓ 28.5 1,570 1

Nested Loop Left Join (cost=213.61..43,112.78 rows=55 width=1,833) (actual time=243.552..784.165 rows=1,570 loops=1)

14. 14.855 782.739 ↓ 28.5 1,570 1

Nested Loop Left Join (cost=213.19..43,086.81 rows=55 width=1,816) (actual time=243.547..782.739 rows=1,570 loops=1)

  • Join Filter: (operadoraoriginalconvenio.id_multitenant = operadora_multitenant_convenio.id)
  • Rows Removed by Join Filter: 164850
15. 1.423 744.334 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=113.19..42,782.75 rows=13 width=1,760) (actual time=227.231..744.334 rows=1,570 loops=1)

16. 1.401 742.911 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=112.90..42,778.56 rows=13 width=1,737) (actual time=227.228..742.911 rows=1,570 loops=1)

17. 1.402 741.510 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=112.47..42,769.81 rows=13 width=1,668) (actual time=227.224..741.510 rows=1,570 loops=1)

18. 1.547 740.108 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=112.19..42,765.85 rows=13 width=1,664) (actual time=227.220..740.108 rows=1,570 loops=1)

19. 1.457 738.561 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=112.05..42,763.64 rows=13 width=1,648) (actual time=227.217..738.561 rows=1,570 loops=1)

20. 1.100 737.104 ↓ 120.8 1,570 1

Hash Left Join (cost=111.77..42,759.67 rows=13 width=1,615) (actual time=227.214..737.104 rows=1,570 loops=1)

  • Hash Cond: (protocoloconvenio.hospital = hospitalconvenio.id)
21. 1.378 735.999 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=110.75..42,758.47 rows=13 width=1,551) (actual time=227.196..735.999 rows=1,570 loops=1)

22. 1.315 734.621 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=110.33..42,752.30 rows=13 width=1,517) (actual time=227.193..734.621 rows=1,570 loops=1)

23. 1.198 733.306 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=110.19..42,750.19 rows=13 width=1,485) (actual time=227.191..733.306 rows=1,570 loops=1)

24. 1.241 732.108 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=110.06..42,748.08 rows=13 width=1,453) (actual time=227.188..732.108 rows=1,570 loops=1)

25. 1.336 730.867 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=109.92..42,745.93 rows=13 width=1,421) (actual time=227.185..730.867 rows=1,570 loops=1)

26. 1.291 729.531 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=109.64..42,742.00 rows=13 width=1,378) (actual time=227.182..729.531 rows=1,570 loops=1)

27. 1.293 728.240 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=109.37..42,738.07 rows=13 width=1,360) (actual time=227.179..728.240 rows=1,570 loops=1)

28. 1.571 726.947 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=108.94..42,731.93 rows=13 width=1,328) (actual time=227.175..726.947 rows=1,570 loops=1)

29. 1.359 725.376 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=108.52..42,666.15 rows=13 width=998) (actual time=227.172..725.376 rows=1,570 loops=1)

30. 0.968 724.017 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=108.09..42,657.40 rows=13 width=1,000) (actual time=227.169..724.017 rows=1,570 loops=1)

31. 1.321 719.909 ↓ 120.8 1,570 1

Hash Left Join (cost=107.66..42,648.65 rows=13 width=976) (actual time=227.160..719.909 rows=1,570 loops=1)

  • Hash Cond: (protocoloprestador.hospital = hospitalprestador.id)
32. 1.204 718.578 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=106.64..42,647.45 rows=13 width=912) (actual time=227.126..718.578 rows=1,570 loops=1)

33. 1.388 712.664 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=106.22..42,641.29 rows=13 width=912) (actual time=227.117..712.664 rows=1,570 loops=1)

  • Join Filter: (competenciaprestador.comp_convenio = detalhes_quitacao_rpa.nome_convenio)
34. 1.231 704.996 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=105.94..42,636.71 rows=13 width=901) (actual time=227.099..704.996 rows=1,570 loops=1)

35. 1.032 703.765 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=105.66..42,632.75 rows=13 width=868) (actual time=227.096..703.765 rows=1,570 loops=1)

36. 16.392 698.023 ↓ 120.8 1,570 1

Nested Loop Left Join (cost=105.52..42,630.60 rows=13 width=836) (actual time=227.077..698.023 rows=1,570 loops=1)

  • Join Filter: (operadoraoriginalprestador.id_multitenant = operadora_multitenant_prestador.id)
  • Rows Removed by Join Filter: 163280
37. 1.447 664.361 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=5.52..42,454.50 rows=3 width=780) (actual time=218.553..664.361 rows=1,570 loops=1)

38. 15.478 662.914 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=5.10..42,453.13 rows=3 width=758) (actual time=218.551..662.914 rows=1,570 loops=1)

  • Join Filter: (guiaprestador.guioperadoraoriginal = operadoraoriginalprestador.id)
  • Rows Removed by Join Filter: 161710
39. 2.350 641.156 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=5.10..42,444.10 rows=3 width=742) (actual time=218.502..641.156 rows=1,570 loops=1)

  • Join Filter: (guiaprestador.guistatusanaliseglosa = statusprestadoranalise.stcodigo)
  • Rows Removed by Join Filter: 23550
40. 3.096 637.236 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=5.10..42,442.23 rows=3 width=710) (actual time=218.491..637.236 rows=1,570 loops=1)

  • Join Filter: (guiaprestador.guistatusconciliacao = statusprestadorconciliacao.stcodigo)
  • Rows Removed by Join Filter: 21980
41. 5.259 632.570 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=5.10..42,440.37 rows=3 width=678) (actual time=218.484..632.570 rows=1,570 loops=1)

  • Join Filter: (guiaprestador.guisituacaoguia = situacaoinicialprestador.sitcodigo)
  • Rows Removed by Join Filter: 37680
42. 129.105 625.741 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=5.10..42,437.93 rows=3 width=646) (actual time=218.474..625.741 rows=1,570 loops=1)

  • Join Filter: (guiaprestador.guimotglosa = motivoglosaprestador.id)
  • Rows Removed by Join Filter: 1590410
43. 111.011 435.406 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=5.10..42,361.69 rows=3 width=603) (actual time=218.082..435.406 rows=1,570 loops=1)

  • Join Filter: (guiaprestador.guicompetencia = competenciaprestador.id)
  • Rows Removed by Join Filter: 1259140
44. 1.905 275.725 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=5.10..42,302.51 rows=3 width=585) (actual time=217.778..275.725 rows=1,570 loops=1)

45. 1.951 270.680 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=4.81..42,301.55 rows=3 width=535) (actual time=217.770..270.680 rows=1,570 loops=1)

46. 2.370 264.019 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=4.39..42,300.13 rows=3 width=482) (actual time=217.760..264.019 rows=1,570 loops=1)

47. 1.423 258.509 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=3.96..42,284.95 rows=3 width=64) (actual time=217.753..258.509 rows=1,570 loops=1)

48. 0.544 257.086 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=3.26..42,272.47 rows=3 width=41) (actual time=217.749..257.086 rows=1,570 loops=1)

49. 0.675 253.402 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=2.83..42,271.05 rows=3 width=38) (actual time=217.746..253.402 rows=1,570 loops=1)

50. 0.584 249.587 ↓ 523.3 1,570 1

Nested Loop Left Join (cost=2.41..42,269.03 rows=3 width=38) (actual time=217.742..249.587 rows=1,570 loops=1)

51. 6.133 245.863 ↓ 523.3 1,570 1

Nested Loop (cost=1.98..42,257.50 rows=3 width=38) (actual time=217.738..245.863 rows=1,570 loops=1)

52. 6.713 206.012 ↓ 240.8 16,859 1

Nested Loop (cost=1.56..42,223.60 rows=70 width=46) (actual time=3.219..206.012 rows=16,859 loops=1)

53. 8.684 165.581 ↓ 240.8 16,859 1

Nested Loop (cost=1.13..42,176.49 rows=70 width=46) (actual time=3.212..165.581 rows=16,859 loops=1)

54. 4.917 123.179 ↓ 14.3 16,859 1

Nested Loop (cost=0.70..37,661.55 rows=1,175 width=38) (actual time=3.204..123.179 rows=16,859 loops=1)

55. 0.410 0.410 ↑ 1.0 23 1

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaprestador_1 (cost=0.28..54.84 rows=23 width=8) (actual time=0.017..0.410 rows=23 loops=1)

  • Filter: (comp_convenio = 'Bradesco'::text)
  • Rows Removed by Filter: 780
56. 117.852 117.852 ↓ 12.9 733 23

Index Scan using idx_fiboguia_guicompetencia_idx on fiboguia guiaprestador_1 (cost=0.43..1,634.50 rows=57 width=46) (actual time=1.055..5.124 rows=733 loops=23)

  • Index Cond: (guicompetencia = competenciaprestador_1.id)
  • Filter: ((discriminador = 'RECURSO'::text) AND (guiorigem = 'HOSPITAL'::text))
  • Rows Removed by Filter: 11922
57. 33.718 33.718 ↑ 1.0 1 16,859

Index Scan using fiboguia_pkey on fiboguia guiahospital (cost=0.43..3.83 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=16,859)

  • Index Cond: (id = guiaprestador_1.guiidguiaprestador)
58. 33.718 33.718 ↑ 1.0 1 16,859

Index Scan using fiboguia_pkey on fiboguia guiaconvparaprestador (cost=0.43..0.66 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=16,859)

  • Index Cond: (id = guiahospital.guiguiaassoc)
59. 33.718 33.718 ↓ 0.0 0 16,859

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloconvparaprestador (cost=0.42..0.47 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=16,859)

  • Index Cond: (id = guiaconvparaprestador.guiprotocolo)
  • Filter: ((data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone) AND (data_pagto >= '2019-06-01 00:00:00'::timestamp without time zone) AND (data_pagto < '2019-07-01 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 1
60. 3.140 3.140 ↑ 1.0 1 1,570

Index Scan using fiboguia_pkey on fiboguia guiaprestrecursada (cost=0.43..3.83 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=1,570)

  • Index Cond: (guiaprestador_1.guiidguiaprestador = id)
61. 3.140 3.140 ↑ 1.0 1 1,570

Index Scan using fiboguia_pkey on fiboguia guiapagrecurso (cost=0.43..0.66 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=1,570)

  • Index Cond: (id = guiaprestrecursada.guiguiaassoc)
62. 3.140 3.140 ↑ 1.0 1 1,570

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocologuiapagrec (cost=0.42..0.46 rows=1 width=19) (actual time=0.002..0.002 rows=1 loops=1,570)

  • Index Cond: (id = guiapagrecurso.guiprotocolo)
63. 0.000 0.000 ↓ 0.0 0 1,570

Nested Loop (cost=0.70..4.15 rows=1 width=23) (actual time=0.000..0.000 rows=0 loops=1,570)

64. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using fiboguia_pkey on fiboguia guiaconvenio_1 (cost=0.43..3.84 rows=1 width=31) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (guiaprestador_1.guiguiaassoc = id)
  • Filter: ((guiorigem = 'CONVENIO'::text) AND ((guicompetenciaassoc = '355434497'::bigint) OR (guicompetencia = '355434497'::bigint)))
65. 0.000 0.000 ↓ 0.0 0

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio_1 (cost=0.28..0.30 rows=1 width=8) (never executed)

  • Index Cond: (id = guiaconvenio_1.guicompetencia)
  • Filter: (comp_convenio = 'Bradesco'::text)
66. 3.140 3.140 ↑ 1.0 1 1,570

Index Scan using fiboguia_pkey on fiboguia guiaprestador (cost=0.43..5.05 rows=1 width=434) (actual time=0.002..0.002 rows=1 loops=1,570)

  • Index Cond: (COALESCE(guiaprestador_1.id, guiaconvenio_1.guiguiaassoc) = id)
67. 4.710 4.710 ↑ 1.0 1 1,570

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=1,570)

  • Index Cond: (guiaprestador.guibenefic = id)
68. 3.140 3.140 ↑ 1.0 1 1,570

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=1,570)

  • Index Cond: (guiaprestador.guiremessa = id)
69. 48.551 48.670 ↑ 1.0 803 1,570

Materialize (cost=0.00..25.05 rows=803 width=26) (actual time=0.000..0.031 rows=803 loops=1,570)

70. 0.119 0.119 ↑ 1.0 803 1

Seq Scan on fibocompetencia competenciaprestador (cost=0.00..21.03 rows=803 width=26) (actual time=0.009..0.119 rows=803 loops=1)

71. 61.093 61.230 ↑ 1.0 1,013 1,570

Materialize (cost=0.00..33.20 rows=1,013 width=59) (actual time=0.000..0.039 rows=1,013 loops=1,570)

72. 0.137 0.137 ↑ 1.0 1,013 1

Seq Scan on fibodefinicaomotivoglosa motivoglosaprestador (cost=0.00..28.13 rows=1,013 width=59) (actual time=0.006..0.137 rows=1,013 loops=1)

73. 1.563 1.570 ↑ 1.0 25 1,570

Materialize (cost=0.00..1.38 rows=25 width=64) (actual time=0.000..0.001 rows=25 loops=1,570)

74. 0.007 0.007 ↑ 1.0 25 1

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

75. 1.559 1.570 ↑ 1.0 15 1,570

Materialize (cost=0.00..1.22 rows=15 width=64) (actual time=0.000..0.001 rows=15 loops=1,570)

76. 0.011 0.011 ↑ 1.0 15 1

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

77. 1.567 1.570 ↑ 1.0 15 1,570

Materialize (cost=0.00..1.22 rows=15 width=64) (actual time=0.000..0.001 rows=15 loops=1,570)

78. 0.003 0.003 ↑ 1.0 15 1

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

79. 6.255 6.280 ↑ 1.0 104 1,570

Materialize (cost=0.00..4.58 rows=105 width=24) (actual time=0.000..0.004 rows=104 loops=1,570)

80. 0.025 0.025 ↑ 1.0 104 1

Seq Scan on fibooperadora operadoraoriginalprestador (cost=0.00..4.05 rows=105 width=24) (actual time=0.004..0.025 rows=104 loops=1)

81. 0.000 0.000 ↓ 0.0 0 1,570

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=1,570)

  • Index Cond: (guiaprestador.gui_quitacao_sistema_gestao = id)
82. 6.805 17.270 ↑ 8.1 105 1,570

Materialize (cost=100.00..139.86 rows=853 width=72) (actual time=0.005..0.011 rows=105 loops=1,570)

83. 10.465 10.465 ↑ 8.1 105 1

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

84. 4.710 4.710 ↑ 1.0 1 1,570

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoassociacaoprestador (cost=0.14..0.16 rows=1 width=64) (actual time=0.002..0.003 rows=1 loops=1,570)

  • Index Cond: (guiaprestador.guisituacaoguiaassoc = sitcodigo)
85. 0.000 0.000 ↓ 0.0 0 1,570

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=1,570)

  • Index Cond: (guiaprestador.guiprestoriginal = id)
86. 6.280 6.280 ↓ 0.0 0 1,570

Index Scan using idx_detalhes_quitacao_rpa_numero_remessa_idx on detalhes_quitacao_rpa (cost=0.28..0.34 rows=1 width=26) (actual time=0.004..0.004 rows=0 loops=1,570)

  • Index Cond: (remessa.rem_numero = numero_remessa)
87. 4.710 4.710 ↑ 1.0 1 1,570

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

  • Index Cond: (guiaprestador.guiprotocolo = id)
88. 0.003 0.010 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=72) (actual time=0.010..0.010 rows=1 loops=1)

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

Seq Scan on fibohospital hospitalprestador (cost=0.00..1.01 rows=1 width=72) (actual time=0.006..0.007 rows=1 loops=1)

90. 3.140 3.140 ↓ 0.0 0 1,570

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=0 loops=1,570)

  • Index Cond: (guiaprestador.id = guiidguiaprestador)
91. 0.000 0.000 ↓ 0.0 0 1,570

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

  • Index Cond: (id = guiarecurso.guiguiaassoc)
92. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using fiboguia_pkey on fiboguia guiaconvenio (cost=0.43..5.05 rows=1 width=346) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (COALESCE(guiaconvenio_1.id, guiaprestador_1.guiguiaassoc) = id)
93. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using fibobeneficiario_pkey on fibobeneficiario beneficiarioconvenio (cost=0.42..0.46 rows=1 width=48) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (guiaconvenio.guibenefic = id)
94. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using fibocompetencia_pkey on fibocompetencia competenciaconvenio (cost=0.28..0.29 rows=1 width=26) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (guiaconvenio.guicompetencia = id)
95. 0.000 0.000 ↓ 0.0 0 1,570

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=1,570)

  • Index Cond: (guiaconvenio.guimotglosa = id)
96. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using fibosituacaoguia_pkey on fibosituacaoguia situacaoconvenio (cost=0.14..0.16 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (guiaconvenio.guisituacaoguia = sitcodigo)
97. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioconciliacao (cost=0.14..0.15 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (guiaconvenio.guistatusconciliacao = stcodigo)
98. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using fibostatustrabalho_pkey on fibostatusguia statusconvenioanalise (cost=0.14..0.15 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (guiaprestador.guistatusanaliseglosa = stcodigo)
99. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using fiboprotocolo_pkey on fiboprotocolo protocoloconvenio (cost=0.42..0.46 rows=1 width=50) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (guiaconvenio.guiprotocolo = id)
100. 0.003 0.005 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=72) (actual time=0.005..0.005 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
101. 0.002 0.002 ↑ 1.0 1 1

Seq Scan on fibohospital hospitalconvenio (cost=0.00..1.01 rows=1 width=72) (actual time=0.002..0.002 rows=1 loops=1)

102. 0.000 0.000 ↓ 0.0 0 1,570

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=1,570)

  • Index Cond: (guiaconvenio.guiprestoriginal = id)
103. 0.000 0.000 ↓ 0.0 0 1,570

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

  • Index Cond: (guiaconvenio.guioperadoraoriginal = id)
104. 0.000 0.000 ↓ 0.0 0 1,570

Index Scan using recebimento_pkey on recebimento (cost=0.28..0.30 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=1,570)

  • Index Cond: (guiaconvenio.recebimento_id = id)
105. 0.000 0.000 ↓ 0.0 0 1,570

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=1,570)

  • Index Cond: (guiaconvenio.guicobrancaoriginal = id)
106. 0.000 0.000 ↓ 0.0 0 1,570

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=1,570)

  • Index Cond: (guiacobrancaoriginal.guiremessa = id)
107. 7.288 23.550 ↑ 8.1 105 1,570

Materialize (cost=100.00..139.86 rows=853 width=72) (actual time=0.009..0.015 rows=105 loops=1,570)

108. 16.262 16.262 ↑ 8.1 105 1

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

109. 0.000 0.000 ↓ 0.0 0 1,570

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=1,570)

  • Index Cond: (guiacobrancaoriginal.guibenefic = id)
110. 3.140 3.140 ↑ 1.0 1 1,570

Index Scan using id_lote_recurso_pkey on lote_recurso (cost=0.29..0.31 rows=1 width=78) (actual time=0.002..0.002 rows=1 loops=1,570)

  • Index Cond: (guiaprestador.id_lote_recurso = id)
111. 10.990 10.990 ↓ 0.0 0 1,570

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.007..0.007 rows=0 loops=1,570)

  • 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: 1
112. 1.571 1.571 ↓ 0.0 0 1,571

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=1,571)

  • Index Cond: (guia_id = guiaprestador.id)
113. 6.612 15.710 ↑ 4.3 104 1,571

Materialize (cost=105.36..150.87 rows=448 width=80) (actual time=0.005..0.010 rows=104 loops=1,571)

114. 0.077 9.098 ↑ 4.3 104 1

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

  • Hash Cond: (operadora_multitenant_cobrancaoriginal.id = operadoraoriginalcobrancaoriginal.id_multitenant)
115. 8.955 8.955 ↑ 8.1 105 1

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

116. 0.027 0.066 ↑ 1.0 104 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
117. 0.039 0.039 ↑ 1.0 104 1

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

118.          

SubPlan (forNested Loop Left Join)

119. 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))
120. 0.201 0.201 ↑ 1.0 565 1

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

  • Filter: (nivel = 'Guia'::text)
  • Rows Removed by Filter: 5
121. 3.142 3.142 ↓ 0.0 0 1,571

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=1,571)

  • Index Cond: (id_guia_originaria = guiaprestador.id)
  • Heap Fetches: 0
122. 0.000 0.000 ↓ 0.0 0 1,571

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.000..0.000 rows=0 loops=1,571)

  • Index Cond: (id_guia_originaria = guiaconvenio.id)
  • Heap Fetches: 0
123. 1.571 3.142 ↑ 1.0 1 1,571

Aggregate (cost=17.33..17.34 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=1,571)

124. 1.571 1.571 ↓ 0.0 0 1,571

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

125. 0.000 0.000 ↓ 0.0 0 1,571

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

126. 0.000 0.000 ↓ 0.0 0 1,571

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

  • Index Cond: (id_guia = guiaconvenio.id)
127. 0.000 0.000 ↓ 0.0 0

Index Scan using fiboglosa_pkey on fiboglosa glosas (cost=0.43..8.45 rows=1 width=45) (never executed)

  • Index Cond: (id = glosasguia.elt)
128. 0.000 0.000 ↓ 0.0 0

Index Scan using fibomotivoglosa_pkey on fibomotivoglosa motivo (cost=0.29..0.31 rows=1 width=68) (never executed)

  • Index Cond: (id = glosas.glo_motivo)
129. 1.571 1.571 ↑ 1.0 1 1,571

Aggregate (cost=8.44..8.45 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1,571)

130. 0.000 0.000 ↓ 0.0 0 1,571

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.000..0.000 rows=0 loops=1,571)

  • Index Cond: (guia_convenio_id = guiaconvenio.id)
131. 0.000 0.000 ↓ 0.0 0 1,571

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=1,571)

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

Initplan (forIndex Scan)

133. 0.000 0.000 ↓ 0.0 0 1,571

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

  • Index Cond: (guiidguiaprestador = guiarecurso.id)
134. 0.000 3.142 ↑ 1.0 1 1,571

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

135. 3.142 3.142 ↓ 0.0 0 1,571

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=1,571)

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

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

Planning time : 42.444 ms
Execution time : 977.156 ms