explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iMEze

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,204.406 ↓ 10.0 10 1

Limit (cost=2,461.00..2,461.00 rows=1 width=361) (actual time=3,204.406..3,204.406 rows=10 loops=1)

2.          

Initplan (forLimit)

3. 0.014 0.014 ↑ 1.0 1 1

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

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

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

5.          

Initplan (forAggregate)

6. 0.006 0.006 ↓ 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.006..0.006 rows=0 loops=1)

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

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

  • Filter: (id_convenio = $15)
  • Rows Removed by Filter: 2928
8. 1.597 3,204.400 ↓ 120.0 120 1

Sort (cost=2,398.42..2,398.43 rows=1 width=361) (actual time=3,204.397..3,204.400 rows=120 loops=1)

  • Sort Key: ipdc.dt_prestacao, forn.ds_razao_social, ipdc.vlr_despesa
  • Sort Method: quicksort Memory: 140kB
9. 12.635 3,202.803 ↓ 225.0 225 1

Nested Loop Left Join (cost=31.50..2,398.41 rows=1 width=361) (actual time=28.567..3,202.803 rows=225 loops=1)

  • Join Filter: (doc.id_tipo_doc = ipdc.id_tipo_doc)
  • Rows Removed by Join Filter: 2475
10. 0.439 12.453 ↓ 225.0 225 1

Nested Loop Left Join (cost=31.50..206.04 rows=1 width=318) (actual time=3.203..12.453 rows=225 loops=1)

11. 1.013 10.664 ↓ 225.0 225 1

Nested Loop Left Join (cost=31.22..204.12 rows=1 width=296) (actual time=3.195..10.664 rows=225 loops=1)

  • Join Filter: (desp.id_despesa = item_desp.id_despesa)
  • Rows Removed by Join Filter: 2250
12. 0.478 9.201 ↓ 225.0 225 1

Nested Loop Left Join (cost=31.22..202.87 rows=1 width=249) (actual time=3.184..9.201 rows=225 loops=1)

13. 0.502 8.048 ↓ 225.0 225 1

Nested Loop Left Join (cost=30.95..201.55 rows=1 width=219) (actual time=3.177..8.048 rows=225 loops=1)

14. 0.600 5.971 ↓ 225.0 225 1

Nested Loop (cost=30.67..194.94 rows=1 width=162) (actual time=3.169..5.971 rows=225 loops=1)

15. 1.835 3.571 ↓ 225.0 225 1

Hash Right Join (cost=30.38..188.15 rows=1 width=154) (actual time=3.157..3.571 rows=225 loops=1)

  • Hash Cond: (pmovto.id_item_pdc = ipdc.id_item_pdc)
16. 1.117 1.117 ↑ 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.010..1.117 rows=8,201 loops=1)

17. 0.161 0.619 ↓ 225.0 225 1

Hash (cost=30.37..30.37 rows=1 width=146) (actual time=0.619..0.619 rows=225 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 32kB
18. 0.142 0.458 ↓ 225.0 225 1

Nested Loop (cost=18.32..30.37 rows=1 width=146) (actual time=0.146..0.458 rows=225 loops=1)

19. 0.015 0.015 ↑ 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.014..0.015 rows=1 loops=1)

  • Index Cond: (id_edicao_pdc = 55452)
20. 0.198 0.301 ↓ 225.0 225 1

Bitmap Heap Scan on tb_item_pdc ipdc (cost=18.03..22.05 rows=1 width=138) (actual time=0.126..0.301 rows=225 loops=1)

  • Recheck Cond: ((id_edicao_pdc = 55452) AND (id_prestacao_contas = epdc.id_prestacao_contas))
  • Filter: (NOT (hashed SubPlan 24))
21. 0.009 0.095 ↓ 0.0 0 1

BitmapAnd (cost=11.91..11.91 rows=1 width=0) (actual time=0.095..0.095 rows=0 loops=1)

22. 0.048 0.048 ↓ 2.4 225 1

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

  • Index Cond: (id_edicao_pdc = 55452)
23. 0.038 0.038 ↑ 1.2 225 1

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

  • Index Cond: (id_prestacao_contas = epdc.id_prestacao_contas)
24.          

SubPlan (forBitmap Heap Scan)

25. 0.008 0.008 ↓ 0.0 0 1

Index Scan using idx_tb_status_item_pdc_id_status_item on tb_status_item_pdc tb_status_item_pdc_8 (cost=0.43..6.11 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (id_status_item = 4)
26. 1.800 1.800 ↑ 1.0 1 225

Index Scan using idx_id_prestacao_contas1 on tb_prestacao_contas pdc (cost=0.29..6.78 rows=1 width=16) (actual time=0.007..0.008 rows=1 loops=225)

  • Index Cond: (id_prestacao_contas = ipdc.id_prestacao_contas)
27. 1.575 1.575 ↑ 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.006..0.007 rows=1 loops=225)

  • Index Cond: (ipdc.id_fornecedor = id_fornecedor)
28. 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)
29. 0.450 0.450 ↑ 1.0 11 225

Seq Scan on tb_despesa desp (cost=0.00..1.11 rows=11 width=47) (actual time=0.001..0.002 rows=11 loops=225)

30. 1.350 1.350 ↑ 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.006 rows=1 loops=225)

  • Index Cond: (id_usuario = ipdc.id_usu_analise)
31. 0.675 0.675 ↑ 1.0 12 225

Seq Scan on tb_tipo_doc doc (cost=0.00..1.12 rows=12 width=47) (actual time=0.001..0.003 rows=12 loops=225)

32.          

SubPlan (forNested Loop Left Join)

33. 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)
34. 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)
35.          

Initplan (forIndex Scan)

36. 0.028 0.140 ↑ 1.0 1 14

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

37. 0.112 0.112 ↓ 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.008..0.008 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
38. 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)
39. 0.675 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)

40. 2.025 2.025 ↑ 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.009 rows=1 loops=225)

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

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

  • Hash Cond: (stp.id_status_item = st.id_status_item)
42. 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)
43. 0.002 0.007 ↑ 1.0 6 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
44. 0.005 0.005 ↑ 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.005 rows=6 loops=1)

45. 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)

46. 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
47. 0.408 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)
48. 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)
49. 0.002 0.004 ↑ 1.0 6 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
50. 0.002 0.002 ↑ 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.002 rows=6 loops=1)

51. 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)

52. 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
53. 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)

54. 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
55. 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)

56. 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
57. 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)

58. 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
59. 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
60. 0.450 0.900 ↑ 1.0 1 225

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

61. 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)
62. 0.450 4.275 ↑ 1.0 1 225

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

63.          

Initplan (forResult)

64. 1.350 3.825 ↑ 1.0 1 225

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

65. 0.000 2.475 ↓ 0.0 0 225

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

66. 0.900 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)

67. 0.900 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)

68. 0.675 0.675 ↑ 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.003 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
69. 0.000 0.000 ↓ 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.000..0.000 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)
70. 5.400 3,134.925 ↓ 8.0 8 225

Group (cost=1,643.04..1,643.06 rows=1 width=148) (actual time=13.909..13.933 rows=8 loops=225)

71. 36.900 3,129.525 ↓ 73.0 73 225

Sort (cost=1,643.04..1,643.04 rows=1 width=148) (actual time=13.906..13.909 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
72. 685.932 3,092.625 ↓ 153.0 153 225

Nested Loop (cost=308.43..1,643.03 rows=1 width=148) (actual time=10.016..13.745 rows=153 loops=225)

  • Join Filter: (i.id_item_despesa = du.id_item_despesa)
  • Rows Removed by Join Filter: 28328
73. 16.425 16.425 ↓ 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.073 rows=156 loops=225)

  • Filter: ((id_despesa = item_desp.id_despesa) AND (id_unidade_adm = 2))
  • Rows Removed by Filter: 281
74. 271.218 2,390.268 ↓ 15.2 182 35,151

Materialize (cost=308.43..1,624.86 rows=12 width=152) (actual time=0.051..0.068 rows=182 loops=35,151)

75. 25.720 2,119.050 ↓ 12.8 153 225

Nested Loop (cost=308.43..1,624.80 rows=12 width=152) (actual time=7.991..9.418 rows=153 loops=225)

76. 4.275 2,058.975 ↓ 12.8 153 225

Nested Loop (cost=308.15..1,621.12 rows=12 width=56) (actual time=7.980..9.151 rows=153 loops=225)

77. 0.900 0.900 ↑ 1.0 1 225

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

  • Filter: (id_despesa = item_desp.id_despesa)
  • Rows Removed by Filter: 10
78. 570.965 2,053.800 ↓ 12.8 153 225

Hash Join (cost=308.15..1,619.86 rows=12 width=8) (actual time=7.976..9.128 rows=153 loops=225)

  • Hash Cond: (desp_1.id_subitem_plt = sub.id_subitem_plt)
79. 1,049.850 1,482.075 ↓ 2.7 27,693 225

Bitmap Heap Scan on tb_desp_subitem desp_1 (cost=201.30..1,473.75 rows=10,436 width=12) (actual time=2.063..6.587 rows=27,693 loops=225)

  • Recheck Cond: (id_despesa = item_desp.id_despesa)
80. 432.225 432.225 ↓ 2.7 27,693 225

Bitmap Index Scan on idx_tb_desp_subitem_id_despesa (cost=0.00..198.69 rows=10,436 width=0) (actual time=1.921..1.921 rows=27,693 loops=225)

  • Index Cond: (id_despesa = item_desp.id_despesa)
81. 0.008 0.760 ↓ 2.4 19 1

Hash (cost=106.76..106.76 rows=8 width=4) (actual time=0.760..0.760 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
82. 0.012 0.752 ↓ 2.4 19 1

Nested Loop (cost=1.13..106.76 rows=8 width=4) (actual time=0.533..0.752 rows=19 loops=1)

83. 0.008 0.683 ↓ 2.7 19 1

Nested Loop (cost=0.84..104.05 rows=7 width=4) (actual time=0.525..0.683 rows=19 loops=1)

84. 0.005 0.621 ↓ 3.0 18 1

Nested Loop (cost=0.56..101.13 rows=6 width=4) (actual time=0.517..0.621 rows=18 loops=1)

85. 0.006 0.556 ↑ 1.0 6 1

Nested Loop (cost=0.28..98.46 rows=6 width=8) (actual time=0.496..0.556 rows=6 loops=1)

86. 0.526 0.526 ↑ 1.0 6 1

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

  • Filter: (id_convenio = 2373)
  • Rows Removed by Filter: 2922
87. 0.024 0.024 ↑ 1.0 1 6

Index Only Scan using pk_tb_plano_trabalho on tb_plt_entidade plt (cost=0.28..7.63 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=6)

  • Index Cond: (id_plt_entidade = plt_conv.id_plt_entidade)
  • Heap Fetches: 6
88. 0.060 0.060 ↓ 3.0 3 6

Index Scan using idx_tb_plt_edicao_id_plt_entidade on tb_plt_edicao plt_ed (cost=0.28..0.43 rows=1 width=8) (actual time=0.007..0.010 rows=3 loops=6)

  • Index Cond: (id_plt_entidade = plt.id_plt_entidade)
  • Filter: (id_status_plt = 5)
  • Rows Removed by Filter: 2
89. 0.054 0.054 ↑ 1.0 1 18

Index Scan using idx_tb_item_plt_id_plt_edicao on tb_item_plt item (cost=0.28..0.48 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=18)

  • Index Cond: (id_plt_edicao = plt_ed.id_plt_edicao)
90. 0.057 0.057 ↑ 1.0 1 19

Index Scan using idx_tb_subitem_plt_id_item_plt on tb_subitem_plt sub (cost=0.28..0.38 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=19)

  • Index Cond: (id_item_plt = item.id_item_plt)
91. 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)
92. 0.048 23.864 ↓ 4.0 4 8

Group (cost=391.89..391.91 rows=1 width=73) (actual time=2.978..2.983 rows=4 loops=8)

93. 0.248 23.816 ↓ 18.0 18 8

Sort (cost=391.89..391.90 rows=1 width=73) (actual time=2.976..2.977 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
94. 0.028 23.568 ↓ 28.0 28 8

Nested Loop (cost=28.87..391.88 rows=1 width=73) (actual time=1.430..2.946 rows=28 loops=8)

95. 0.228 23.096 ↓ 28.0 28 8

Nested Loop (cost=28.60..391.48 rows=1 width=55) (actual time=1.425..2.887 rows=28 loops=8)

96. 0.092 22.424 ↓ 28.0 28 8

Nested Loop (cost=28.60..390.33 rows=1 width=16) (actual time=1.419..2.803 rows=28 loops=8)

  • Join Filter: (plt_conv_1.id_plt_entidade = plt_1.id_plt_entidade)
97. 4.800 21.888 ↓ 28.0 28 8

Nested Loop (cost=28.32..389.86 rows=1 width=24) (actual time=1.410..2.736 rows=28 loops=8)

  • Join Filter: (ped.id_plt_entidade = plt_conv_1.id_plt_entidade)
  • Rows Removed by Join Filter: 3504
98. 0.000 17.088 ↓ 24.5 589 8

Nested Loop (cost=28.32..335.09 rows=24 width=20) (actual time=0.198..2.136 rows=589 loops=8)

99. 2.136 7.400 ↓ 11.7 645 8

Hash Join (cost=28.04..297.86 rows=55 width=20) (actual time=0.186..0.925 rows=645 loops=8)

  • Hash Cond: (item_ped_nova.id_item_despesa_nova = du_1.id_item_despesa)
100. 4.088 4.776 ↓ 1.4 645 8

Bitmap Heap Scan on tb_item_pedido_nova item_ped_nova (cost=17.88..284.85 rows=461 width=12) (actual time=0.114..0.597 rows=645 loops=8)

  • Recheck Cond: (id_despesa_nova = item_desp.id_despesa)
  • Filter: (id_status_item_ped = 2)
  • Rows Removed by Filter: 322
101. 0.688 0.688 ↓ 1.3 967 8

Bitmap Index Scan on idx_tb_item_pedido_nova_id_despesa_nova (cost=0.00..17.77 rows=731 width=0) (actual time=0.086..0.086 rows=967 loops=8)

  • Index Cond: (id_despesa_nova = item_desp.id_despesa)
102. 0.088 0.488 ↓ 1.1 53 8

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

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
103. 0.400 0.400 ↓ 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.050 rows=53 loops=8)

  • Filter: ((id_despesa = item_desp.id_despesa) AND (id_unidade_adm = 2))
  • Rows Removed by Filter: 384
104. 10.314 10.314 ↑ 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.002 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.265 0.265 ↑ 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.244..0.265 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.444 0.444 ↑ 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.002 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)