explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZQMx

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

Limit (cost=2,172.26..2,172.26 rows=1 width=361) (actual time=3,672.963..3,672.965 rows=10 loops=1)

2.          

Initplan (forLimit)

3. 0.012 0.012 ↑ 1.0 1 1

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

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

Aggregate (cost=16.60..16.61 rows=1 width=0) (actual time=0.010..0.011 rows=1 loops=1)

5.          

Initplan (forAggregate)

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

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

Index Only Scan using idx_tb_plt_convenio_id_convenio on tb_plt_convenio (cost=0.28..8.30 rows=1 width=0) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (id_convenio = $15)
  • Heap Fetches: 0
8. 1.855 3,672.961 ↓ 120.0 120 1

Sort (cost=2,153.98..2,153.99 rows=1 width=361) (actual time=3,672.953..3,672.961 rows=120 loops=1)

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

Nested Loop Left Join (cost=16.96..2,153.97 rows=1 width=361) (actual time=11.512..3,671.106 rows=225 loops=1)

10. 0.509 10.582 ↓ 225.0 225 1

Nested Loop Left Join (cost=16.83..50.77 rows=1 width=318) (actual time=0.273..10.582 rows=225 loops=1)

11. 0.635 8.723 ↓ 225.0 225 1

Nested Loop Left Join (cost=16.55..48.85 rows=1 width=296) (actual time=0.263..8.723 rows=225 loops=1)

12. 0.542 7.188 ↓ 225.0 225 1

Nested Loop Left Join (cost=16.42..48.66 rows=1 width=249) (actual time=0.255..7.188 rows=225 loops=1)

13. 0.575 5.746 ↓ 225.0 225 1

Nested Loop Left Join (cost=16.15..47.34 rows=1 width=219) (actual time=0.245..5.746 rows=225 loops=1)

14. 0.607 3.371 ↓ 225.0 225 1

Nested Loop Left Join (cost=15.86..40.73 rows=1 width=162) (actual time=0.235..3.371 rows=225 loops=1)

15. 0.430 1.189 ↓ 225.0 225 1

Nested Loop (cost=15.58..35.65 rows=1 width=154) (actual time=0.227..1.189 rows=225 loops=1)

16. 0.006 0.039 ↑ 1.0 1 1

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

17. 0.022 0.022 ↑ 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.021..0.022 rows=1 loops=1)

  • Index Cond: (id_edicao_pdc = 55452)
18. 0.011 0.011 ↑ 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.010..0.011 rows=1 loops=1)

  • Index Cond: (id_prestacao_contas = epdc.id_prestacao_contas)
19. 0.604 0.720 ↓ 225.0 225 1

Bitmap Heap Scan on tb_item_pdc ipdc (cost=15.00..19.02 rows=1 width=138) (actual time=0.186..0.720 rows=225 loops=1)

  • Recheck Cond: ((id_prestacao_contas = pdc.id_prestacao_contas) AND (id_edicao_pdc = 55452))
  • Filter: (NOT (hashed SubPlan 24))
20. 0.011 0.106 ↓ 0.0 0 1

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

21. 0.053 0.053 ↑ 1.2 225 1

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

  • Index Cond: (id_prestacao_contas = pdc.id_prestacao_contas)
22. 0.042 0.042 ↓ 2.4 225 1

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

  • Index Cond: (id_edicao_pdc = 55452)
23.          

SubPlan (forBitmap Heap Scan)

24. 0.010 0.010 ↓ 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.010..0.010 rows=0 loops=1)

  • Index Cond: (id_status_item = 4)
25. 1.575 1.575 ↓ 0.0 0 225

Index Scan using idx_tb_pdc_movto on tb_pdc_movto pmovto (cost=0.29..5.07 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
26. 1.800 1.800 ↑ 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.008 rows=1 loops=225)

  • Index Cond: (ipdc.id_fornecedor = id_fornecedor)
27. 0.900 0.900 ↑ 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.004 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.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.005..0.006 rows=1 loops=225)

  • Index Cond: (id_usuario = ipdc.id_usu_analise)
30. 1.350 1.350 ↑ 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.006 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.042 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)

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.633 0.633 ↑ 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.003..0.003 rows=1 loops=211)

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

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

39. 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.009..0.009 rows=1 loops=225)

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

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

  • Hash Cond: (stp.id_status_item = st.id_status_item)
41. 0.618 0.618 ↑ 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.003 rows=1 loops=206)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
42. 0.002 0.009 ↑ 1.0 6 1

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

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

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

44. 0.450 1.125 ↑ 1.0 1 225

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

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

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

Hash Join (cost=1.56..9.64 rows=2 width=4) (actual time=0.004..0.005 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.004 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.001 0.001 ↑ 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.001 rows=6 loops=1)

50. 0.675 1.350 ↑ 1.0 1 225

Aggregate (cost=8.49..8.50 rows=1 width=6) (actual time=0.006..0.006 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.003..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 1.125 ↑ 1.0 1 225

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

53. 0.675 0.675 ↓ 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.003..0.003 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.225 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.675 0.675 ↓ 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.003..0.003 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.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)

57. 0.675 0.675 ↓ 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.003..0.003 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.350 1.350 ↑ 1.0 1 225

Seq Scan on tb_tipo_doc_unidade (cost=0.00..1.21 rows=1 width=5) (actual time=0.005..0.006 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.350 ↑ 1.0 1 225

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

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

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
61. 0.450 4.950 ↑ 1.0 1 225

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

62.          

Initplan (forResult)

63. 1.350 4.500 ↑ 1.0 1 225

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

64. 0.225 3.150 ↓ 0.0 0 225

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

65. 0.900 2.925 ↓ 0.0 0 225

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

66. 1.125 1.800 ↑ 1.0 1 225

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

67. 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.003..0.003 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. 6.075 3,595.725 ↓ 8.0 8 225

Group (cost=1,598.87..1,598.89 rows=1 width=148) (actual time=15.953..15.981 rows=8 loops=225)

70. 42.075 3,589.650 ↓ 73.0 73 225

Sort (cost=1,598.87..1,598.88 rows=1 width=148) (actual time=15.951..15.954 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: 65kB
71. 785.097 3,547.575 ↓ 153.0 153 225

Nested Loop (cost=264.26..1,598.86 rows=1 width=148) (actual time=11.452..15.767 rows=153 loops=225)

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

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

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

Materialize (cost=264.26..1,580.70 rows=12 width=152) (actual time=0.058..0.078 rows=182 loops=35,151)

74. 5.090 2,418.075 ↓ 12.8 153 225

Nested Loop (cost=264.26..1,580.64 rows=12 width=152) (actual time=9.067..10.747 rows=153 loops=225)

75. 5.175 2,344.275 ↓ 12.8 153 225

Nested Loop (cost=263.99..1,576.95 rows=12 width=56) (actual time=9.053..10.419 rows=153 loops=225)

76. 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
77. 660.110 2,338.200 ↓ 12.8 153 225

Hash Join (cost=263.99..1,575.70 rows=12 width=8) (actual time=9.048..10.392 rows=153 loops=225)

  • Hash Cond: (desp_1.id_subitem_plt = sub.id_subitem_plt)
78. 1,183.500 1,677.825 ↓ 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.350..7.457 rows=27,693 loops=225)

  • Recheck Cond: (id_despesa = item_desp.id_despesa)
79. 494.325 494.325 ↓ 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=2.197..2.197 rows=27,693 loops=225)

  • Index Cond: (id_despesa = item_desp.id_despesa)
80. 0.009 0.265 ↓ 2.4 19 1

Hash (cost=62.60..62.60 rows=8 width=4) (actual time=0.265..0.265 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
81. 0.021 0.256 ↓ 2.4 19 1

Nested Loop (cost=1.41..62.60 rows=8 width=4) (actual time=0.050..0.256 rows=19 loops=1)

82. 0.000 0.178 ↓ 2.7 19 1

Nested Loop (cost=1.12..59.89 rows=7 width=4) (actual time=0.042..0.178 rows=19 loops=1)

83. 0.008 0.106 ↓ 3.0 18 1

Nested Loop (cost=0.84..56.97 rows=6 width=4) (actual time=0.034..0.106 rows=18 loops=1)

84. 0.010 0.044 ↑ 1.0 6 1

Nested Loop (cost=0.56..54.30 rows=6 width=8) (actual time=0.018..0.044 rows=6 loops=1)

85. 0.010 0.010 ↑ 1.0 6 1

Index Scan using idx_tb_plt_convenio_id_convenio on tb_plt_convenio plt_conv (cost=0.28..8.44 rows=6 width=4) (actual time=0.008..0.010 rows=6 loops=1)

  • Index Cond: (id_convenio = 2373)
86. 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
87. 0.054 0.054 ↓ 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.006..0.009 rows=3 loops=6)

  • Index Cond: (id_plt_entidade = plt.id_plt_entidade)
  • Filter: (id_status_plt = 5)
  • Rows Removed by Filter: 2
88. 0.072 0.072 ↑ 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.004 rows=1 loops=18)

  • Index Cond: (id_plt_edicao = plt_ed.id_plt_edicao)
89. 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)
90. 68.710 68.710 ↑ 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.002 rows=1 loops=34,355)

  • Index Cond: (id_item_despesa = desp_1.id_item_despesa)
91. 0.064 27.824 ↓ 4.0 4 8

Group (cost=347.73..347.75 rows=1 width=73) (actual time=3.472..3.478 rows=4 loops=8)

92. 0.288 27.760 ↓ 18.0 18 8

Sort (cost=347.73..347.74 rows=1 width=73) (actual time=3.469..3.470 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
93. 0.100 27.472 ↓ 28.0 28 8

Nested Loop (cost=29.15..347.72 rows=1 width=73) (actual time=1.881..3.434 rows=28 loops=8)

94. 0.268 26.928 ↓ 28.0 28 8

Nested Loop (cost=28.88..347.32 rows=1 width=55) (actual time=1.876..3.366 rows=28 loops=8)

95. 0.148 26.216 ↓ 28.0 28 8

Nested Loop (cost=28.88..346.17 rows=1 width=16) (actual time=1.868..3.277 rows=28 loops=8)

  • Join Filter: (plt_conv_1.id_plt_entidade = plt_1.id_plt_entidade)
96. 5.288 25.624 ↓ 28.0 28 8

Nested Loop (cost=28.60..345.70 rows=1 width=24) (actual time=1.857..3.203 rows=28 loops=8)

  • Join Filter: (ped.id_plt_entidade = plt_conv_1.id_plt_entidade)
  • Rows Removed by Join Filter: 3504
97. 1.582 20.336 ↓ 24.5 589 8

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

98. 2.496 8.440 ↓ 11.7 645 8

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

  • Hash Cond: (item_ped_nova.id_item_despesa_nova = du_1.id_item_despesa)
99. 4.408 5.304 ↓ 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.144..0.663 rows=645 loops=8)

  • Recheck Cond: (id_despesa_nova = item_desp.id_despesa)
  • Filter: (id_status_item_ped = 2)
  • Rows Removed by Filter: 322
100. 0.896 0.896 ↓ 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.112..0.112 rows=967 loops=8)

  • Index Cond: (id_despesa_nova = item_desp.id_despesa)
101. 0.144 0.640 ↓ 1.1 53 8

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

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
102. 0.496 0.496 ↓ 1.1 53 8

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

  • Filter: ((id_despesa = item_desp.id_despesa) AND (id_unidade_adm = 2))
  • Rows Removed by Filter: 384
103. 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.002..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
104. 0.000 0.000 ↑ 1.0 6 4,709

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

105. 0.016 0.016 ↑ 1.0 6 1

Index Scan using idx_tb_plt_convenio_id_convenio on tb_plt_convenio plt_conv_1 (cost=0.28..8.44 rows=6 width=4) (actual time=0.010..0.016 rows=6 loops=1)

  • Index Cond: (id_convenio = 2373)
106. 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
107. 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
108. 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.002..0.002 rows=1 loops=222)

  • Index Cond: (id_item_despesa = item_ped_nova.id_item_despesa_nova)
109. 1.125 1.125 ↑ 1.0 1 225

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

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

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

111. 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)
112. 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)
113. 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)