explain.depesz.com

PostgreSQL's explain analyze made readable

Result: t2ho

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 5,650.591 ↓ 10.0 10 1

Limit (cost=2,169.04..2,169.04 rows=1 width=320) (actual time=5,650.590..5,650.591 rows=10 loops=1)

2.          

Initplan (forLimit)

3. 0.034 0.034 ↑ 1.0 1 1

Seq Scan on tb_tipo_customizacao (cost=0.00..1.66 rows=1 width=3) (actual time=0.024..0.034 rows=1 loops=1)

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

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

5.          

Initplan (forAggregate)

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

  • Index Cond: (id_convenio_edicao = 55452)
7. 0.021 0.021 ↓ 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.021..0.021 rows=0 loops=1)

  • Index Cond: (id_convenio = $15)
  • Heap Fetches: 0
8. 2.485 5,650.586 ↓ 120.0 120 1

Sort (cost=2,150.77..2,150.77 rows=1 width=320) (actual time=5,650.575..5,650.586 rows=120 loops=1)

  • Sort Key: ipdc.dt_prestacao, forn.ds_razao_social, ipdc.vlr_despesa
  • Sort Method: quicksort Memory: 141kB
9. 21.367 5,648.101 ↓ 225.0 225 1

Nested Loop Anti Join (cost=12.21..2,150.76 rows=1 width=320) (actual time=98.012..5,648.101 rows=225 loops=1)

  • Join Filter: (ipdc.id_item_pdc = tb_status_item_pdc.id_item_pdc)
10. 0.769 41.046 ↓ 225.0 225 1

Nested Loop Left Join (cost=11.78..39.50 rows=1 width=320) (actual time=9.854..41.046 rows=225 loops=1)

11. 0.891 38.252 ↓ 225.0 225 1

Nested Loop Left Join (cost=11.65..39.25 rows=1 width=303) (actual time=9.833..38.252 rows=225 loops=1)

12. 0.688 35.111 ↓ 225.0 225 1

Nested Loop Left Join (cost=11.37..38.38 rows=1 width=281) (actual time=9.781..35.111 rows=225 loops=1)

13. 0.817 33.073 ↓ 225.0 225 1

Nested Loop Left Join (cost=11.24..38.19 rows=1 width=251) (actual time=9.762..33.073 rows=225 loops=1)

14. 0.773 30.456 ↓ 225.0 225 1

Nested Loop Left Join (cost=10.97..37.53 rows=1 width=221) (actual time=9.733..30.456 rows=225 loops=1)

15. 0.927 15.958 ↓ 225.0 225 1

Nested Loop Left Join (cost=10.68..32.89 rows=1 width=164) (actual time=9.646..15.958 rows=225 loops=1)

16. 0.693 5.581 ↓ 225.0 225 1

Nested Loop (cost=10.40..30.47 rows=1 width=156) (actual time=2.332..5.581 rows=225 loops=1)

17. 0.010 0.129 ↑ 1.0 1 1

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

18. 0.071 0.071 ↑ 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.068..0.071 rows=1 loops=1)

  • Index Cond: (id_edicao_pdc = 55452)
19. 0.048 0.048 ↑ 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.046..0.048 rows=1 loops=1)

  • Index Cond: (id_prestacao_contas = epdc.id_prestacao_contas)
20. 2.626 4.759 ↓ 225.0 225 1

Bitmap Heap Scan on tb_item_pdc ipdc (cost=9.82..13.83 rows=1 width=140) (actual time=2.193..4.759 rows=225 loops=1)

  • Recheck Cond: ((id_prestacao_contas = pdc.id_prestacao_contas) AND (id_edicao_pdc = 55452))
21. 0.044 2.133 ↓ 0.0 0 1

BitmapAnd (cost=9.82..9.82 rows=1 width=0) (actual time=2.133..2.133 rows=0 loops=1)

22. 1.941 1.941 ↓ 1.2 450 1

Bitmap Index Scan on fki_id_prestacao_contas (cost=0.00..4.11 rows=362 width=0) (actual time=1.941..1.941 rows=450 loops=1)

  • Index Cond: (id_prestacao_contas = pdc.id_prestacao_contas)
23. 0.148 0.148 ↓ 1.7 225 1

Bitmap Index Scan on idx_id_edicao_pdc (cost=0.00..5.42 rows=133 width=0) (actual time=0.148..0.148 rows=225 loops=1)

  • Index Cond: (id_edicao_pdc = 55452)
24. 9.450 9.450 ↓ 0.0 0 225

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

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
25. 13.725 13.725 ↑ 1.0 1 225

Index Scan using pk_tb_fornecedor on tb_fornecedor forn (cost=0.29..4.63 rows=1 width=61) (actual time=0.059..0.061 rows=1 loops=225)

  • Index Cond: (ipdc.id_fornecedor = id_fornecedor)
26. 1.800 1.800 ↑ 1.0 1 225

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

  • Index Cond: (ipdc.id_item_despesa = id_item_despesa)
27. 1.350 1.350 ↑ 1.0 1 225

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

  • Index Cond: (id_despesa = item_desp.id_despesa)
28. 2.250 2.250 ↑ 1.0 1 225

Index Scan using pk_tb_usuario on tb_usuario usu (cost=0.28..0.86 rows=1 width=30) (actual time=0.008..0.010 rows=1 loops=225)

  • Index Cond: (id_usuario = ipdc.id_usu_analise)
29. 2.025 2.025 ↑ 1.0 1 225

Index Scan using pk_tb_tipo_doc on tb_tipo_doc doc (cost=0.14..0.24 rows=1 width=21) (actual time=0.005..0.009 rows=1 loops=225)

  • Index Cond: (id_tipo_doc = ipdc.id_tipo_doc)
30. 0.205 10.800 ↓ 0.0 0 225

Materialize (cost=0.43..8.45 rows=1 width=4) (actual time=0.048..0.048 rows=0 loops=225)

31. 10.595 10.595 ↓ 0.0 0 1

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

  • Index Cond: (id_status_item = 4)
32.          

SubPlan (forNested Loop Anti Join)

33. 10.350 10.350 ↑ 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.046..0.046 rows=1 loops=225)

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

Index Scan using pk_tb_item_prestacao_contas on tb_item_pdc tb_item_pdc_2 (cost=23.93..31.95 rows=1 width=116) (never executed)

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

Initplan (forIndex Scan)

36. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=23.49..23.50 rows=1 width=4) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_id_item on tb_item_pdc tb_item_pdc_1 (cost=0.43..23.49 rows=2 width=4) (never executed)

  • Index Cond: (id_item = ipdc.id_item)
  • Filter: ((ds_analise IS NOT NULL) AND (ds_analise <> ''::text))
38. 0.900 0.900 ↑ 1.0 1 225

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.004..0.004 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
39. 1.350 9.000 ↑ 1.0 1 225

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

40. 7.650 7.650 ↑ 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.033..0.034 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
  • Heap Fetches: 249
41. 1.199 2.050 ↑ 2.0 1 205

Hash Join (cost=1.56..9.64 rows=2 width=9) (actual time=0.010..0.010 rows=1 loops=205)

  • Hash Cond: (stp.id_status_item = st.id_status_item)
42. 0.820 0.820 ↑ 2.0 1 205

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.003..0.004 rows=1 loops=205)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
43. 0.007 0.031 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=13) (actual time=0.031..0.031 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
44. 0.024 0.024 ↑ 1.0 6 1

Seq Scan on tb_status_item st (cost=0.00..1.06 rows=6 width=13) (actual time=0.017..0.024 rows=6 loops=1)

45. 0.675 1.575 ↑ 1.0 1 225

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

46. 0.900 0.900 ↑ 2.0 1 225

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

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
  • Heap Fetches: 249
47. 0.803 1.435 ↑ 2.0 1 205

Hash Join (cost=1.56..9.64 rows=2 width=4) (actual time=0.006..0.007 rows=1 loops=205)

  • Hash Cond: (stp_1.id_status_item = st_1.id_status_item)
48. 0.615 0.615 ↑ 2.0 1 205

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.003..0.003 rows=1 loops=205)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
49. 0.009 0.017 ↑ 1.0 6 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
50. 0.008 0.008 ↑ 1.0 6 1

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

51. 0.675 1.800 ↑ 1.0 1 225

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

52. 1.125 1.125 ↑ 1.0 1 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.004..0.005 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.450 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)

54. 0.900 0.900 ↓ 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.004..0.004 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.450 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)

56. 0.900 0.900 ↓ 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.004..0.004 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.675 1.575 ↑ 1.0 1 225

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

58. 0.900 0.900 ↓ 0.0 0 225

Index Scan using fki_id_item_pdc on tb_status_item_pdc tb_status_item_pdc_6 (cost=0.43..8.48 rows=1 width=6) (actual time=0.004..0.004 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.800 1.800 ↑ 1.0 1 225

Seq Scan on tb_tipo_doc_unidade (cost=0.00..1.21 rows=1 width=2) (actual time=0.007..0.008 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.900 1.800 ↑ 1.0 1 225

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

61. 0.900 0.900 ↑ 2.0 1 225

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=6) (actual time=0.004..0.004 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
62. 0.900 7.200 ↑ 1.0 1 225

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

63.          

Initplan (forResult)

64. 2.025 6.300 ↑ 1.0 1 225

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

65. 0.225 4.275 ↓ 0.0 0 225

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

66. 1.350 4.050 ↓ 0.0 0 225

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

67. 1.350 2.475 ↑ 1.0 1 225

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

68. 1.125 1.125 ↑ 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.004..0.005 rows=1 loops=225)

  • Index Cond: (id_item_pdc = ipdc.id_item_pdc)
69. 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)
70. 8.775 5,442.975 ↓ 8.0 8 225

Group (cost=1,598.92..1,598.94 rows=1 width=128) (actual time=24.148..24.191 rows=8 loops=225)

71. 63.675 5,434.200 ↓ 73.0 73 225

Sort (cost=1,598.92..1,598.93 rows=1 width=128) (actual time=24.143..24.152 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. 1,154.031 5,370.525 ↓ 153.0 153 225

Nested Loop (cost=264.28..1,598.91 rows=1 width=128) (actual time=17.446..23.869 rows=153 loops=225)

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

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

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

Materialize (cost=264.28..1,580.75 rows=12 width=132) (actual time=0.089..0.119 rows=182 loops=35,151)

75. 10.110 3,679.650 ↓ 12.8 153 225

Nested Loop (cost=264.28..1,580.69 rows=12 width=132) (actual time=13.863..16.354 rows=153 loops=225)

76. 7.875 3,566.475 ↓ 12.8 153 225

Nested Loop (cost=264.01..1,577.00 rows=12 width=36) (actual time=13.845..15.851 rows=153 loops=225)

77. 1.575 1.575 ↑ 1.0 1 225

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

  • Filter: (id_despesa = item_desp.id_despesa)
  • Rows Removed by Filter: 10
78. 992.039 3,557.025 ↓ 12.8 153 225

Hash Join (cost=264.01..1,575.74 rows=12 width=8) (actual time=13.836..15.809 rows=153 loops=225)

  • Hash Cond: (desp_1.id_subitem_plt = sub.id_subitem_plt)
79. 1,696.050 2,548.350 ↓ 2.7 27,701 225

Bitmap Heap Scan on tb_desp_subitem desp_1 (cost=201.31..1,473.79 rows=10,438 width=12) (actual time=4.021..11.326 rows=27,701 loops=225)

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

Bitmap Index Scan on idx_tb_desp_subitem_id_despesa (cost=0.00..198.70 rows=10,438 width=0) (actual time=3.788..3.788 rows=27,701 loops=225)

  • Index Cond: (id_despesa = item_desp.id_despesa)
81. 0.024 16.636 ↓ 2.4 19 1

Hash (cost=62.59..62.59 rows=8 width=4) (actual time=16.636..16.636 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
82. 0.037 16.612 ↓ 2.4 19 1

Nested Loop (cost=1.41..62.59 rows=8 width=4) (actual time=14.139..16.612 rows=19 loops=1)

83. 0.089 14.542 ↓ 2.7 19 1

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

84. 0.163 12.329 ↓ 3.0 18 1

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

85. 0.044 8.896 ↑ 1.0 6 1

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

86. 8.726 8.726 ↑ 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=8.722..8.726 rows=6 loops=1)

  • Index Cond: (id_convenio = 2373)
87. 0.126 0.126 ↑ 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.020..0.021 rows=1 loops=6)

  • Index Cond: (id_plt_entidade = plt_conv.id_plt_entidade)
  • Heap Fetches: 6
88. 3.270 3.270 ↓ 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.539..0.545 rows=3 loops=6)

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

  • Index Cond: (id_plt_edicao = plt_ed.id_plt_edicao)
90. 2.033 2.033 ↑ 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.107..0.107 rows=1 loops=19)

  • Index Cond: (id_item_plt = item.id_item_plt)
91. 103.065 103.065 ↑ 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.002..0.003 rows=1 loops=34,355)

  • Index Cond: (id_item_despesa = desp_1.id_item_despesa)
92. 0.120 87.928 ↓ 4.0 4 8

Group (cost=347.59..347.60 rows=1 width=56) (actual time=10.979..10.991 rows=4 loops=8)

93. 0.640 87.808 ↓ 18.0 18 8

Sort (cost=347.59..347.59 rows=1 width=56) (actual time=10.974..10.976 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.474 87.168 ↓ 28.0 28 8

Nested Loop (cost=27.99..347.58 rows=1 width=56) (actual time=6.460..10.896 rows=28 loops=8)

95. 0.794 85.584 ↓ 28.0 28 8

Nested Loop (cost=27.71..347.17 rows=1 width=38) (actual time=6.447..10.698 rows=28 loops=8)

96. 0.388 83.680 ↓ 28.0 28 8

Nested Loop (cost=27.71..346.02 rows=1 width=16) (actual time=6.429..10.460 rows=28 loops=8)

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

Nested Loop (cost=27.43..345.55 rows=1 width=24) (actual time=6.408..10.245 rows=28 loops=8)

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

Nested Loop (cost=27.15..334.94 rows=24 width=20) (actual time=2.982..8.728 rows=589 loops=8)

99. 6.528 39.952 ↓ 11.7 645 8

Hash Join (cost=26.87..297.71 rows=55 width=20) (actual time=2.958..4.994 rows=645 loops=8)

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

Bitmap Heap Scan on tb_item_pedido_nova item_ped_nova (cost=17.89..285.87 rows=461 width=12) (actual time=1.648..2.892 rows=645 loops=8)

  • Recheck Cond: (id_despesa_nova = item_desp.id_despesa)
  • Filter: (id_status_item_ped = 2)
  • Rows Removed by Filter: 323
101. 12.680 12.680 ↓ 1.3 969 8

Bitmap Index Scan on idx_tb_item_pedido_nova_id_despesa_nova (cost=0.00..17.77 rows=732 width=0) (actual time=1.585..1.585 rows=969 loops=8)

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

Hash (cost=8.39..8.39 rows=48 width=8) (actual time=1.286..1.286 rows=53 loops=8)

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

Bitmap Heap Scan on tb_despesa_unidade du_1 (cost=4.65..8.39 rows=48 width=8) (actual time=1.230..1.257 rows=53 loops=8)

  • Recheck Cond: (id_despesa = item_desp.id_despesa)
  • Filter: (id_unidade_adm = 2)
  • Rows Removed by Filter: 0
104. 9.744 9.744 ↓ 1.1 54 8

Bitmap Index Scan on idx_tb_despesa_unidade_id_despesa (cost=0.00..4.64 rows=49 width=0) (actual time=1.218..1.218 rows=54 loops=8)

  • Index Cond: (id_despesa = item_desp.id_despesa)
105. 25.785 25.785 ↑ 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.004..0.005 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
106. 4.679 4.709 ↑ 1.0 6 4,709

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

107. 0.030 0.030 ↑ 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.024..0.030 rows=6 loops=1)

  • Index Cond: (id_convenio = 2373)
108. 1.332 1.332 ↑ 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.005..0.006 rows=1 loops=222)

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

Seq Scan on tb_despesa d_1 (cost=0.00..1.14 rows=1 width=30) (actual time=0.003..0.005 rows=1 loops=222)

  • Filter: (id_despesa = item_desp.id_despesa)
  • Rows Removed by Filter: 10
110. 1.110 1.110 ↑ 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.004..0.005 rows=1 loops=222)

  • Index Cond: (id_item_despesa = item_ped_nova.id_item_despesa_nova)
111. 1.800 1.800 ↑ 1.0 1 225

Seq Scan on tb_status_pdc (cost=0.00..1.05 rows=1 width=2) (actual time=0.007..0.008 rows=1 loops=225)

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

Aggregate (cost=9.62..9.63 rows=1 width=0) (never executed)

113. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=0.43..9.62 rows=1 width=0) (never executed)

  • Join Filter: (tb_status_item_pdc_8.id_status_item = tb_status_item.id_status_item)
114. 0.000 0.000 ↓ 0.0 0

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

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

Materialize (cost=0.00..1.08 rows=2 width=4) (never executed)

116. 0.000 0.000 ↓ 0.0 0

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

  • Filter: (flg_alt_item = 'S'::bpchar)