explain.depesz.com

PostgreSQL's explain analyze made readable

Result: y9Xd

Settings
# exclusive inclusive rows x rows loops node
1. 0.060 175.269 ↓ 18.5 37 1

WindowAgg (cost=210,799.15..210,799.32 rows=2 width=262) (actual time=174.721..175.269 rows=37 loops=1)

  • Functions: 48
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 12.857 ms, Inlining 0.000 ms, Optimization 4.773 ms, Emission 78.346 ms, Total 95.976 ms
2. 0.531 175.209 ↓ 18.5 37 1

GroupAggregate (cost=210,799.15..210,799.27 rows=2 width=250) (actual time=174.695..175.209 rows=37 loops=1)

  • Group Key: bic.bic_cd_bico, pro.pro_cd_produto, abt.abt_vl_preco_unitario, abt.abt_cd_substituicao, bom.bom_cd_bomba, cai.cai_cd_caixa
3. 0.311 174.678 ↓ 347.0 694 1

Sort (cost=210,799.15..210,799.16 rows=2 width=82) (actual time=174.651..174.678 rows=694 loops=1)

  • Sort Key: bic.bic_cd_bico, pro.pro_cd_produto, abt.abt_vl_preco_unitario, abt.abt_cd_substituicao, bom.bom_cd_bomba
  • Sort Method: quicksort Memory: 122kB
4. 54.520 174.367 ↓ 347.0 694 1

Nested Loop (cost=13.29..210,799.14 rows=2 width=82) (actual time=108.211..174.367 rows=694 loops=1)

  • Join Filter: (bic.bic_cd_bomba = bom.bom_cd_bomba)
  • Rows Removed by Join Filter: 902,200
5. 0.155 0.155 ↑ 1.0 1,301 1

Seq Scan on bomba bom (cost=0.00..31.01 rows=1,301 width=12) (actual time=0.027..0.155 rows=1,301 loops=1)

6. 30.506 119.692 ↓ 347.0 694 1,301

Materialize (cost=13.29..210,729.11 rows=2 width=74) (actual time=0.065..0.092 rows=694 loops=1,301)

7. 0.517 89.186 ↓ 347.0 694 1

Nested Loop (cost=13.29..210,729.10 rows=2 width=74) (actual time=84.212..89.186 rows=694 loops=1)

8. 0.209 87.975 ↓ 347.0 694 1

Hash Join (cost=12.87..210,724.03 rows=2 width=74) (actual time=84.198..87.975 rows=694 loops=1)

  • Hash Cond: (abt.abt_cd_bico = bic.bic_cd_bico)
9. 0.475 87.717 ↑ 1.3 694 1

Nested Loop (cost=1.70..210,709.48 rows=895 width=46) (actual time=84.134..87.717 rows=694 loops=1)

10. 84.231 85.842 ↑ 1.5 700 1

Nested Loop (cost=1.13..207,851.75 rows=1,066 width=17) (actual time=84.118..85.842 rows=700 loops=1)

11. 0.291 0.291 ↑ 1.1 440 1

Index Scan using venda_idx_caixa on venda ven (cost=0.56..505.69 rows=471 width=8) (actual time=0.026..0.291 rows=440 loops=1)

  • Index Cond: (ven_cd_caixa = 1,385,105)
12. 1.320 1.320 ↑ 221.0 2 440

Index Scan using venda_item_idx_venda_rebuild_2 on venda_item vei (cost=0.57..435.81 rows=442 width=17) (actual time=0.003..0.003 rows=2 loops=440)

  • Index Cond: (vei_cd_venda = ven.ven_cd_venda)
13. 1.400 1.400 ↑ 1.0 1 700

Index Scan using abastecimento_abt_cd_venda_item_key on abastecimento abt (cost=0.57..2.68 rows=1 width=37) (actual time=0.002..0.002 rows=1 loops=700)

  • Index Cond: (abt_cd_venda_item = vei.vei_cd_venda_item)
14. 0.008 0.049 ↓ 3.1 28 1

Hash (cost=11.06..11.06 rows=9 width=36) (actual time=0.049..0.049 rows=28 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
15. 0.011 0.041 ↓ 3.1 28 1

Nested Loop (cost=0.71..11.06 rows=9 width=36) (actual time=0.021..0.041 rows=28 loops=1)

16. 0.009 0.009 ↑ 1.0 1 1

Index Scan using caixa_pkey on caixa cai (cost=0.42..2.64 rows=1 width=28) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (cai_cd_caixa = 1,385,105)
17. 0.021 0.021 ↓ 2.5 28 1

Index Scan using bico_idx_pdv on bico bic (cost=0.28..8.30 rows=11 width=16) (actual time=0.008..0.021 rows=28 loops=1)

  • Index Cond: (bic_cd_pdv = cai.cai_cd_pdv)
18. 0.694 0.694 ↑ 1.0 1 694

Index Only Scan using produto_pkey on produto pro (cost=0.42..2.53 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=694)

  • Index Cond: (pro_cd_produto = vei.vei_cd_produto)
  • Heap Fetches: 694
Execution time : 188.393 ms