explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OV7T

Settings
# exclusive inclusive rows x rows loops node
1. 1.076 4,526.614 ↓ 225.0 225 1

Sort (cost=44,724.32..44,724.33 rows=1 width=361) (actual time=4,526.608..4,526.614 rows=225 loops=1)

  • Sort Key: ipdc.dt_prestacao, forn.ds_razao_social, ipdc.vlr_despesa
  • Sort Method: quicksort Memory: 140kB
2.          

Initplan (forSort)

3. 0.008 0.008 ↑ 1.0 1 1

Seq Scan on tb_tipo_customizacao (cost=0.00..1.66 rows=1 width=19) (actual time=0.006..0.008 rows=1 loops=1)

  • Filter: ((id_customizacao = 20) AND (ativo = 'S'::bpchar))
  • Rows Removed by Filter: 43
4. 0.000 0.325 ↑ 1.0 1 1

Aggregate (cost=60.90..60.91 rows=1 width=0) (actual time=0.325..0.325 rows=1 loops=1)

5.          

Initplan (forAggregate)

6. 0.005 0.005 ↓ 0.0 0 1

Index Scan using pk_tb_convenio_edicao on tb_convenio_edicao (cost=0.28..8.30 rows=1 width=4) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (id_convenio_edicao = 55452)
7. 0.320 0.320 ↓ 0.0 0 1

Seq Scan on tb_plt_convenio (cost=0.00..52.60 rows=1 width=0) (actual time=0.320..0.320 rows=0 loops=1)

  • Filter: (id_convenio = $15)
  • Rows Removed by Filter: 2928
8. 13.326 4,525.205 ↓ 225.0 225 1

Nested Loop Left Join (cost=40,775.74..44,661.74 rows=1 width=361) (actual time=273.180..4,525.205 rows=225 loops=1)

9. 0.615 253.535 ↓ 225.0 225 1

Nested Loop Left Join (cost=40,775.61..40,942.45 rows=1 width=318) (actual time=245.846..253.535 rows=225 loops=1)

10. 0.638 251.795 ↓ 225.0 225 1

Nested Loop Left Join (cost=40,775.33..40,940.53 rows=1 width=296) (actual time=245.837..251.795 rows=225 loops=1)

11. 0.641 250.257 ↓ 225.0 225 1

Nested Loop Left Join (cost=40,775.20..40,940.34 rows=1 width=249) (actual time=245.821..250.257 rows=225 loops=1)

12. 0.674 248.941 ↓ 225.0 225 1

Nested Loop Left Join (cost=40,774.92..40,939.02 rows=1 width=219) (actual time=245.811..248.941 rows=225 loops=1)

13. 1.203 246.242 ↓ 225.0 225 1

Hash Right Join (cost=40,774.64..40,932.41 rows=1 width=162) (actual time=245.791..246.242 rows=225 loops=1)

  • Hash Cond: (pmovto.id_item_pdc = ipdc.id_item_pdc)
14. 0.628 0.628 ↑ 1.0 8,201 1

Seq Scan on tb_pdc_movto pmovto (cost=0.00..127.01 rows=8,201 width=12) (actual time=0.006..0.628 rows=8,201 loops=1)

15. 0.118 244.411 ↓ 225.0 225 1

Hash (cost=40,774.63..40,774.63 rows=1 width=154) (actual time=244.411..244.411 rows=225 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 33kB
16. 0.097 244.293 ↓ 225.0 225 1

Nested Loop (cost=40,754.55..40,774.63 rows=1 width=154) (actual time=244.082..244.293 rows=225 loops=1)

17. 0.003 0.026 ↑ 1.0 1 1

Nested Loop (cost=0.58..16.63 rows=1 width=24) (actual time=0.019..0.026 rows=1 loops=1)

18. 0.013 0.013 ↑ 1.0 1 1

Index Scan using pk_tb_ed_item_pdc on tb_edicao_pdc epdc (cost=0.29..8.31 rows=1 width=8) (actual time=0.011..0.013 rows=1 loops=1)

  • Index Cond: (id_edicao_pdc = 55452)
19. 0.010 0.010 ↑ 1.0 1 1

Index Scan using idx_id_prestacao_contas1 on tb_prestacao_contas pdc (cost=0.29..8.31 rows=1 width=16) (actual time=0.005..0.010 rows=1 loops=1)

  • Index Cond: (id_prestacao_contas = epdc.id_prestacao_contas)
20. 0.129 244.170 ↓ 225.0 225 1

Bitmap Heap Scan on tb_item_pdc ipdc (cost=40,753.97..40,757.99 rows=1 width=138) (actual time=244.057..244.170 rows=225 loops=1)

  • Recheck Cond: ((id_prestacao_contas = pdc.id_prestacao_contas) AND (id_edicao_pdc = 55452))
  • Filter: (NOT (hashed SubPlan 24))
21. 0.006 0.066 ↓ 0.0 0 1

BitmapAnd (cost=8.88..8.88 rows=1 width=0) (actual time=0.066..0.066 rows=0 loops=1)

22. 0.026 0.026 ↑ 1.2 225 1

Bitmap Index Scan on fki_id_prestacao_contas (cost=0.00..3.50 rows=280 width=0) (actual time=0.026..0.026 rows=225 loops=1)

  • Index Cond: (id_prestacao_contas = pdc.id_prestacao_contas)
23. 0.034 0.034 ↓ 2.4 225 1

Bitmap Index Scan on idx_id_edicao_pdc (cost=0.00..5.12 rows=93 width=0) (actual time=0.034..0.034 rows=225 loops=1)

  • Index Cond: (id_edicao_pdc = 55452)
24.          

SubPlan (forBitmap Heap Scan)

25. 243.975 243.975 ↓ 0.0 0 1

Seq Scan on tb_status_item_pdc tb_status_item_pdc_8 (cost=0.00..40,745.09 rows=1 width=4) (actual time=243.975..243.975 rows=0 loops=1)

  • Filter: (id_status_item = 4)
  • Rows Removed by Filter: 2158967
26. 2.025 2.025 ↑ 1.0 1 225

Index Scan using pk_tb_fornecedor on tb_fornecedor forn (cost=0.29..6.60 rows=1 width=61) (actual time=0.007..0.009 rows=1 loops=225)

  • Index Cond: (ipdc.id_fornecedor = id_fornecedor)
27. 0.675 0.675 ↑ 1.0 1 225

Index Scan using idx_id_item_despesa1 on tb_item_despesa item_desp (cost=0.27..1.31 rows=1 width=30) (actual time=0.003..0.003 rows=1 loops=225)

  • Index Cond: (ipdc.id_item_despesa = id_item_despesa)
28. 0.900 0.900 ↑ 1.0 1 225

Index Scan using pk_tb_despesas on tb_despesa desp (cost=0.14..0.18 rows=1 width=47) (actual time=0.003..0.004 rows=1 loops=225)

  • Index Cond: (id_despesa = item_desp.id_despesa)
29. 1.125 1.125 ↑ 1.0 1 225

Index Scan using pk_tb_usuario on tb_usuario usu (cost=0.28..1.91 rows=1 width=30) (actual time=0.004..0.005 rows=1 loops=225)

  • Index Cond: (id_usuario = ipdc.id_usu_analise)
30. 1.125 1.125 ↑ 1.0 1 225

Index Scan using pk_tb_tipo_doc on tb_tipo_doc doc (cost=0.14..0.41 rows=1 width=47) (actual time=0.003..0.005 rows=1 loops=225)

  • Index Cond: (id_tipo_doc = ipdc.id_tipo_doc)
31.          

SubPlan (forNested Loop Left Join)

32. 2.025 2.025 ↑ 1.0 1 225

Index Scan using pk_tb_item_prestacao_contas on tb_item_pdc (cost=0.43..8.45 rows=1 width=116) (actual time=0.009..0.009 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
33. 0.000 0.000 ↓ 0.0 0 14

Index Scan using pk_tb_item_prestacao_contas on tb_item_pdc tb_item_pdc_2 (cost=23.88..31.89 rows=1 width=116) (actual time=0.000..0.000 rows=0 loops=14)

  • Index Cond: (id_item_pdc = $2)
34.          

Initplan (forIndex Scan)

35. 0.028 0.126 ↑ 1.0 1 14

Aggregate (cost=23.44..23.45 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=14)

36. 0.098 0.098 ↓ 0.0 0 14

Index Scan using idx_id_item on tb_item_pdc tb_item_pdc_1 (cost=0.43..23.43 rows=2 width=4) (actual time=0.007..0.007 rows=0 loops=14)

  • Index Cond: (id_item = ipdc.id_item)
  • Filter: ((ds_analise IS NOT NULL) AND (ds_analise <> ''::text))
  • Rows Removed by Filter: 1
37. 0.422 0.422 ↑ 1.0 1 211

Index Scan using pk_tb_item_prestacao_contas on tb_item_pdc tb_item_pdc_3 (cost=0.43..8.45 rows=1 width=116) (actual time=0.002..0.002 rows=1 loops=211)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
38. 0.900 2.700 ↑ 1.0 1 225

Aggregate (cost=8.48..8.49 rows=1 width=4) (actual time=0.012..0.012 rows=1 loops=225)

39. 1.800 1.800 ↑ 2.0 1 225

Index Only Scan using fki_id_item_pdc on tb_status_item_pdc (cost=0.43..8.48 rows=2 width=4) (actual time=0.008..0.008 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
  • Heap Fetches: 248
40. 0.610 1.030 ↑ 2.0 1 206

Hash Join (cost=1.56..9.64 rows=2 width=43) (actual time=0.005..0.005 rows=1 loops=206)

  • Hash Cond: (stp.id_status_item = st.id_status_item)
41. 0.412 0.412 ↑ 2.0 1 206

Index Scan using fki_id_item_pdc on tb_status_item_pdc stp (cost=0.43..8.48 rows=2 width=4) (actual time=0.002..0.002 rows=1 loops=206)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
42. 0.004 0.008 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=47) (actual time=0.008..0.008 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
43. 0.004 0.004 ↑ 1.0 6 1

Seq Scan on tb_status_item st (cost=0.00..1.06 rows=6 width=47) (actual time=0.003..0.004 rows=6 loops=1)

44. 0.450 0.900 ↑ 1.0 1 225

Aggregate (cost=8.48..8.49 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=225)

45. 0.450 0.450 ↑ 2.0 1 225

Index Only Scan using fki_id_item_pdc on tb_status_item_pdc tb_status_item_pdc_1 (cost=0.43..8.48 rows=2 width=4) (actual time=0.002..0.002 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
  • Heap Fetches: 248
46. 0.407 0.824 ↑ 2.0 1 206

Hash Join (cost=1.56..9.64 rows=2 width=4) (actual time=0.004..0.004 rows=1 loops=206)

  • Hash Cond: (stp_1.id_status_item = st_1.id_status_item)
47. 0.412 0.412 ↑ 2.0 1 206

Index Scan using fki_id_item_pdc on tb_status_item_pdc stp_1 (cost=0.43..8.48 rows=2 width=4) (actual time=0.002..0.002 rows=1 loops=206)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
48. 0.001 0.005 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=4) (actual time=0.005..0.005 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
49. 0.004 0.004 ↑ 1.0 6 1

Seq Scan on tb_status_item st_1 (cost=0.00..1.06 rows=6 width=4) (actual time=0.001..0.004 rows=6 loops=1)

50. 0.450 1.125 ↑ 1.0 1 225

Aggregate (cost=8.49..8.50 rows=1 width=6) (actual time=0.005..0.005 rows=1 loops=225)

51. 0.675 0.675 ↑ 1.0 1 225

Index Scan using fki_id_item_pdc on tb_status_item_pdc tb_status_item_pdc_2 (cost=0.43..8.48 rows=1 width=6) (actual time=0.002..0.003 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
  • Filter: (id_status_item = 1)
  • Rows Removed by Filter: 0
52. 0.450 0.900 ↑ 1.0 1 225

Aggregate (cost=8.49..8.50 rows=1 width=6) (actual time=0.004..0.004 rows=1 loops=225)

53. 0.450 0.450 ↓ 0.0 0 225

Index Scan using fki_id_item_pdc on tb_status_item_pdc tb_status_item_pdc_3 (cost=0.43..8.48 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
  • Filter: (id_status_item = 2)
  • Rows Removed by Filter: 1
54. 0.450 0.900 ↑ 1.0 1 225

Aggregate (cost=8.49..8.50 rows=1 width=6) (actual time=0.004..0.004 rows=1 loops=225)

55. 0.450 0.450 ↓ 0.0 0 225

Index Scan using fki_id_item_pdc on tb_status_item_pdc tb_status_item_pdc_4 (cost=0.43..8.48 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
  • Filter: (id_status_item = 5)
  • Rows Removed by Filter: 1
56. 0.225 0.675 ↑ 1.0 1 225

Aggregate (cost=8.49..8.50 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=225)

57. 0.450 0.450 ↓ 0.0 0 225

Index Scan using fki_id_item_pdc on tb_status_item_pdc tb_status_item_pdc_5 (cost=0.43..8.48 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
  • Filter: (id_status_item = 6)
  • Rows Removed by Filter: 1
58. 1.125 1.125 ↑ 1.0 1 225

Seq Scan on tb_tipo_doc_unidade (cost=0.00..1.21 rows=1 width=5) (actual time=0.004..0.005 rows=1 loops=225)

  • Filter: ((id_tipo_doc = ipdc.id_tipo_doc) AND (flg_status = 'A'::bpchar) AND (id_unidade_adm = 2))
  • Rows Removed by Filter: 11
59. 0.675 1.125 ↑ 1.0 1 225

Aggregate (cost=8.48..8.49 rows=1 width=6) (actual time=0.005..0.005 rows=1 loops=225)

60. 0.450 0.450 ↑ 2.0 1 225

Index Scan using fki_id_item_pdc on tb_status_item_pdc tb_status_item_pdc_6 (cost=0.43..8.48 rows=2 width=6) (actual time=0.002..0.002 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
61. 0.675 4.725 ↑ 1.0 1 225

Result (cost=16.73..16.75 rows=1 width=0) (actual time=0.021..0.021 rows=1 loops=225)

62.          

Initplan (forResult)

63. 1.350 4.050 ↑ 1.0 1 225

Aggregate (cost=16.72..16.73 rows=1 width=0) (actual time=0.018..0.018 rows=1 loops=225)

64. 0.225 2.700 ↓ 0.0 0 225

HashAggregate (cost=16.70..16.71 rows=1 width=60) (actual time=0.012..0.012 rows=0 loops=225)

65. 0.675 2.475 ↓ 0.0 0 225

Nested Loop (cost=8.64..16.70 rows=1 width=60) (actual time=0.011..0.011 rows=0 loops=225)

66. 1.125 1.575 ↑ 1.0 1 225

HashAggregate (cost=8.49..8.50 rows=1 width=10) (actual time=0.007..0.007 rows=1 loops=225)

67. 0.450 0.450 ↑ 2.0 1 225

Index Scan using fki_id_item_pdc on tb_status_item_pdc sip (cost=0.43..8.48 rows=2 width=10) (actual time=0.002..0.002 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
68. 0.225 0.225 ↓ 0.0 0 225

Index Scan using pk_tb_pdc_fr on tb_pdc_fr (cost=0.15..8.18 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=225)

  • Index Cond: (id_pdc_fr = sip.id_pdc_fr)
  • Filter: ((id_item_pdc = ipdc.id_item_pdc) AND CASE WHEN ((sum(sip.vlr_item)) <> valor) THEN true ELSE false END)
69. 4.950 4,212.675 ↓ 8.0 8 225

Group (cost=3,122.92..3,122.94 rows=1 width=148) (actual time=18.700..18.723 rows=8 loops=225)

70. 35.550 4,207.725 ↓ 73.0 73 225

Sort (cost=3,122.92..3,122.92 rows=1 width=148) (actual time=18.698..18.701 rows=73 loops=225)

  • Sort Key: i.ds_item_despesa, d.ds_despesa, i.ds_descricao, d.flg_qtde, d.id_despesa, i.id_item_despesa
  • Sort Method: quicksort Memory: 51kB
71. 676.701 4,172.175 ↓ 153.0 153 225

Nested Loop (cost=614.30..3,122.91 rows=1 width=148) (actual time=14.932..18.543 rows=153 loops=225)

  • Join Filter: (i.id_item_despesa = du.id_item_despesa)
  • Rows Removed by Join Filter: 28328
72. 15.525 15.525 ↓ 3.2 156 225

Seq Scan on tb_despesa_unidade du (cost=0.00..9.55 rows=48 width=8) (actual time=0.005..0.069 rows=156 loops=225)

  • Filter: ((id_despesa = item_desp.id_despesa) AND (id_unidade_adm = 2))
  • Rows Removed by Filter: 281
73. 247.149 3,479.949 ↓ 15.2 182 35,151

Materialize (cost=614.30..3,104.74 rows=12 width=152) (actual time=0.076..0.099 rows=182 loops=35,151)

74. 25.045 3,232.800 ↓ 12.8 153 225

Nested Loop (cost=614.30..3,104.68 rows=12 width=152) (actual time=11.858..14.368 rows=153 loops=225)

75. 4.725 3,173.400 ↓ 12.8 153 225

Nested Loop (cost=614.02..3,101.00 rows=12 width=56) (actual time=11.844..14.104 rows=153 loops=225)

76. 0.675 0.675 ↑ 1.0 1 225

Seq Scan on tb_despesa d (cost=0.00..1.14 rows=1 width=52) (actual time=0.002..0.003 rows=1 loops=225)

  • Filter: (id_despesa = item_desp.id_despesa)
  • Rows Removed by Filter: 10
77. 425.167 3,168.000 ↓ 12.8 153 225

Hash Join (cost=614.02..3,099.74 rows=12 width=8) (actual time=11.839..14.080 rows=153 loops=225)

  • Hash Cond: (desp_1.id_subitem_plt = sub.id_subitem_plt)
78. 2,739.150 2,739.150 ↓ 2.7 27,693 225

Seq Scan on tb_desp_subitem desp_1 (cost=0.00..2,446.46 rows=10,436 width=12) (actual time=0.004..12.174 rows=27,693 loops=225)

  • Filter: (id_despesa = item_desp.id_despesa)
  • Rows Removed by Filter: 76664
79. 0.002 3.683 ↓ 2.4 19 1

Hash (cost=613.92..613.92 rows=8 width=4) (actual time=3.683..3.683 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
80. 0.596 3.681 ↓ 2.4 19 1

Hash Join (cost=425.05..613.92 rows=8 width=4) (actual time=3.512..3.681 rows=19 loops=1)

  • Hash Cond: (sub.id_item_plt = item.id_item_plt)
81. 0.521 0.521 ↑ 1.0 6,894 1

Seq Scan on tb_subitem_plt sub (cost=0.00..162.94 rows=6,894 width=8) (actual time=0.002..0.521 rows=6,894 loops=1)

82. 0.007 2.564 ↓ 2.7 19 1

Hash (cost=424.96..424.96 rows=7 width=4) (actual time=2.564..2.564 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
83. 0.555 2.557 ↓ 2.7 19 1

Hash Join (cost=214.11..424.96 rows=7 width=4) (actual time=2.361..2.557 rows=19 loops=1)

  • Hash Cond: (item.id_plt_edicao = plt_ed.id_plt_edicao)
84. 0.668 0.668 ↑ 1.0 6,239 1

Seq Scan on tb_item_plt item (cost=0.00..187.39 rows=6,239 width=8) (actual time=0.003..0.668 rows=6,239 loops=1)

85. 0.002 1.334 ↓ 3.0 18 1

Hash (cost=214.03..214.03 rows=6 width=4) (actual time=1.334..1.334 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
86. 0.010 1.332 ↓ 3.0 18 1

Nested Loop (cost=52.96..214.03 rows=6 width=4) (actual time=0.873..1.332 rows=18 loops=1)

  • Join Filter: (plt_conv.id_plt_entidade = plt.id_plt_entidade)
87. 0.298 1.286 ↓ 3.0 18 1

Hash Join (cost=52.68..211.72 rows=6 width=12) (actual time=0.860..1.286 rows=18 loops=1)

  • Hash Cond: (plt_ed.id_plt_entidade = plt_conv.id_plt_entidade)
88. 0.739 0.739 ↑ 1.0 3,316 1

Seq Scan on tb_plt_edicao plt_ed (cost=0.00..142.40 rows=3,316 width=8) (actual time=0.004..0.739 rows=3,316 loops=1)

  • Filter: (id_status_plt = 5)
  • Rows Removed by Filter: 2316
89. 0.001 0.249 ↑ 1.0 6 1

Hash (cost=52.60..52.60 rows=6 width=4) (actual time=0.249..0.249 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
90. 0.248 0.248 ↑ 1.0 6 1

Seq Scan on tb_plt_convenio plt_conv (cost=0.00..52.60 rows=6 width=4) (actual time=0.229..0.248 rows=6 loops=1)

  • Filter: (id_convenio = 2373)
  • Rows Removed by Filter: 2922
91. 0.036 0.036 ↑ 1.0 1 18

Index Only Scan using pk_tb_plano_trabalho on tb_plt_entidade plt (cost=0.28..0.37 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=18)

  • Index Cond: (id_plt_entidade = plt_ed.id_plt_entidade)
  • Heap Fetches: 18
92. 34.355 34.355 ↑ 1.0 1 34,355

Index Scan using idx_id_item_despesa1 on tb_item_despesa i (cost=0.27..0.30 rows=1 width=96) (actual time=0.001..0.001 rows=1 loops=34,355)

  • Index Cond: (id_item_despesa = desp_1.id_item_despesa)
93. 0.056 25.168 ↓ 4.0 4 8

Group (cost=439.77..439.79 rows=1 width=73) (actual time=3.141..3.146 rows=4 loops=8)

94. 0.216 25.112 ↓ 18.0 18 8

Sort (cost=439.77..439.78 rows=1 width=73) (actual time=3.138..3.139 rows=18 loops=8)

  • Sort Key: i_1.ds_item_despesa, d_1.ds_despesa, d_1.id_despesa, i_1.id_item_despesa
  • Sort Method: quicksort Memory: 29kB
95. 0.226 24.896 ↓ 28.0 28 8

Nested Loop (cost=10.99..439.76 rows=1 width=73) (actual time=1.544..3.112 rows=28 loops=8)

96. 0.148 24.448 ↓ 28.0 28 8

Nested Loop (cost=10.71..439.36 rows=1 width=55) (actual time=1.539..3.056 rows=28 loops=8)

97. 0.076 23.856 ↓ 28.0 28 8

Nested Loop (cost=10.71..438.21 rows=1 width=16) (actual time=1.533..2.982 rows=28 loops=8)

  • Join Filter: (plt_conv_1.id_plt_entidade = plt_1.id_plt_entidade)
98. 4.480 23.336 ↓ 28.0 28 8

Nested Loop (cost=10.43..437.74 rows=1 width=24) (actual time=1.522..2.917 rows=28 loops=8)

  • Join Filter: (ped.id_plt_entidade = plt_conv_1.id_plt_entidade)
  • Rows Removed by Join Filter: 3504
99. 3.995 18.856 ↓ 24.5 589 8

Nested Loop (cost=10.43..382.97 rows=24 width=20) (actual time=0.093..2.357 rows=589 loops=8)

100. 1.768 9.704 ↓ 11.7 645 8

Hash Join (cost=10.15..345.73 rows=55 width=20) (actual time=0.081..1.213 rows=645 loops=8)

  • Hash Cond: (item_ped_nova.id_item_despesa_nova = du_1.id_item_despesa)
101. 7.432 7.432 ↓ 1.4 645 8

Seq Scan on tb_item_pedido_nova item_ped_nova (cost=0.00..332.73 rows=461 width=12) (actual time=0.005..0.929 rows=645 loops=8)

  • Filter: ((id_despesa_nova = item_desp.id_despesa) AND (id_status_item_ped = 2))
  • Rows Removed by Filter: 4470
102. 0.088 0.504 ↓ 1.1 53 8

Hash (cost=9.55..9.55 rows=48 width=8) (actual time=0.063..0.063 rows=53 loops=8)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
103. 0.416 0.416 ↓ 1.1 53 8

Seq Scan on tb_despesa_unidade du_1 (cost=0.00..9.55 rows=48 width=8) (actual time=0.007..0.052 rows=53 loops=8)

  • Filter: ((id_despesa = item_desp.id_despesa) AND (id_unidade_adm = 2))
  • Rows Removed by Filter: 384
104. 5.157 5.157 ↑ 1.0 1 5,157

Index Scan using pk_tb_pedido_alteracao on tb_pedido_alteracao ped (cost=0.28..0.67 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=5,157)

  • Index Cond: (id_pedido_alteracao = item_ped_nova.id_pedido_alteracao)
  • Filter: (id_status_ped = 3)
  • Rows Removed by Filter: 0
105. 0.000 0.000 ↑ 1.0 6 4,709

Materialize (cost=0.00..52.63 rows=6 width=4) (actual time=0.000..0.000 rows=6 loops=4,709)

106. 0.278 0.278 ↑ 1.0 6 1

Seq Scan on tb_plt_convenio plt_conv_1 (cost=0.00..52.60 rows=6 width=4) (actual time=0.258..0.278 rows=6 loops=1)

  • Filter: (id_convenio = 2373)
  • Rows Removed by Filter: 2922
107. 0.444 0.444 ↑ 1.0 1 222

Index Only Scan using pk_tb_plano_trabalho on tb_plt_entidade plt_1 (cost=0.28..0.46 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=222)

  • Index Cond: (id_plt_entidade = ped.id_plt_entidade)
  • Heap Fetches: 222
108. 0.444 0.444 ↑ 1.0 1 222

Seq Scan on tb_despesa d_1 (cost=0.00..1.14 rows=1 width=47) (actual time=0.001..0.002 rows=1 loops=222)

  • Filter: (id_despesa = item_desp.id_despesa)
  • Rows Removed by Filter: 10
109. 0.222 0.222 ↑ 1.0 1 222

Index Scan using idx_id_item_despesa1 on tb_item_despesa i_1 (cost=0.27..0.40 rows=1 width=26) (actual time=0.001..0.001 rows=1 loops=222)

  • Index Cond: (id_item_despesa = item_ped_nova.id_item_despesa_nova)
110. 0.900 0.900 ↑ 1.0 1 225

Seq Scan on tb_status_pdc (cost=0.00..1.05 rows=1 width=5) (actual time=0.004..0.004 rows=1 loops=225)

  • Filter: (id_status_pdc = epdc.id_status_pdc)
  • Rows Removed by Filter: 3
111. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=9.58..9.59 rows=1 width=0) (never executed)

112. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.43..9.58 rows=1 width=0) (never executed)

  • Join Filter: (tb_status_item_pdc_7.id_status_item = tb_status_item.id_status_item)
113. 0.000 0.000 ↓ 0.0 0

Seq Scan on tb_status_item (cost=0.00..1.07 rows=1 width=4) (never executed)

  • Filter: (flg_alt_item = 'S'::bpchar)
114. 0.000 0.000 ↓ 0.0 0

Index Scan using fki_id_item_pdc on tb_status_item_pdc tb_status_item_pdc_7 (cost=0.43..8.48 rows=2 width=4) (never executed)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)