explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0TW1

Settings
# exclusive inclusive rows x rows loops node
1. 5,717.568 17,733.861 ↓ 1.0 1,597,358 1

WindowAgg (cost=5,483,027.80..5,525,800.88 rows=1,555,385 width=2,278) (actual time=11,611.153..17,733.861 rows=1,597,358 loops=1)

2. 3,428.954 12,016.293 ↓ 1.0 1,597,358 1

Sort (cost=5,483,027.80..5,486,916.26 rows=1,555,385 width=2,278) (actual time=11,611.131..12,016.293 rows=1,597,358 loops=1)

  • Sort Key: a.id, bp_stan_produkt.data_od DESC
  • Sort Method: external sort Disk: 570672kB
3. 1,111.739 8,587.339 ↓ 1.0 1,597,358 1

Hash Left Join (cost=57,714.02..729,808.97 rows=1,555,385 width=2,278) (actual time=337.498..8,587.339 rows=1,597,358 loops=1)

  • Hash Cond: ((bp_stan_produkt.id_podstan_produkt = d2.id) AND (a.id_bank = d2.id_bank))
4. 1,158.364 7,466.355 ↓ 1.0 1,597,358 1

Hash Left Join (cost=57,493.97..514,082.03 rows=1,555,385 width=2,263) (actual time=328.237..7,466.355 rows=1,597,358 loops=1)

  • Hash Cond: ((bp_stan_produkt.id_stan_produkt = d1.id) AND (a.id_bank = d1.id_bank))
5. 1,156.826 6,293.592 ↓ 1.0 1,597,358 1

Hash Left Join (cost=57,401.97..335,120.76 rows=1,555,385 width=2,248) (actual time=313.824..6,293.592 rows=1,597,358 loops=1)

  • Hash Cond: ((a.id_status_produkt = d_bp_status_produkt.id) AND (a.id_bank = d_bp_status_produkt.id_bank))
6. 1,209.834 5,129.588 ↓ 1.0 1,597,358 1

Merge Left Join (cost=57,385.77..280,666.08 rows=1,555,385 width=2,234) (actual time=306.626..5,129.588 rows=1,597,358 loops=1)

  • Merge Cond: (a.id = bp_stan_produkt.id_produkt)
7. 688.466 1,467.225 ↑ 1.0 440,840 1

Merge Left Join (cost=57,380.06..139,516.26 rows=440,840 width=2,202) (actual time=306.608..1,467.225 rows=440,840 loops=1)

  • Merge Cond: (a.id = z.id_produkt)
8. 336.850 336.850 ↑ 1.0 440,840 1

Index Scan using bp_produkt_pkey on bp_produkt a (cost=0.42..73,320.26 rows=440,840 width=2,196) (actual time=0.010..336.850 rows=440,840 loops=1)

9. 66.738 441.909 ↑ 1.0 440,840 1

Materialize (cost=57,379.42..59,583.62 rows=440,840 width=14) (actual time=306.589..441.909 rows=440,840 loops=1)

10. 281.626 375.171 ↑ 1.0 440,840 1

Sort (cost=57,379.42..58,481.52 rows=440,840 width=14) (actual time=306.587..375.171 rows=440,840 loops=1)

  • Sort Key: z.id_produkt
  • Sort Method: external sort Disk: 11456kB
11. 93.545 93.545 ↑ 1.0 440,840 1

Seq Scan on an_mz_saldo_akt z (cost=0.00..8,515.40 rows=440,840 width=14) (actual time=5.977..93.545 rows=440,840 loops=1)

12. 2,452.529 2,452.529 ↑ 1.0 1,555,385 1

Index Scan using idxbp_stan_produkt_id_produkt on bp_stan_produkt (cost=0.43..120,605.41 rows=1,555,385 width=40) (actual time=0.013..2,452.529 rows=1,555,385 loops=1)

13. 0.067 7.178 ↑ 1.0 408 1

Hash (cost=10.08..10.08 rows=408 width=30) (actual time=7.178..7.178 rows=408 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 35kB
14. 7.111 7.111 ↑ 1.0 408 1

Seq Scan on d_bp_status_produkt (cost=0.00..10.08 rows=408 width=30) (actual time=6.817..7.111 rows=408 loops=1)

15. 0.348 14.399 ↑ 1.0 2,040 1

Hash (cost=61.40..61.40 rows=2,040 width=39) (actual time=14.399..14.399 rows=2,040 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 165kB
16. 14.051 14.051 ↑ 1.0 2,040 1

Seq Scan on d_bp_stan_produkt d1 (cost=0.00..61.40 rows=2,040 width=39) (actual time=3.702..14.051 rows=2,040 loops=1)

17. 0.906 9.245 ↑ 1.0 5,202 1

Hash (cost=142.02..142.02 rows=5,202 width=39) (actual time=9.245..9.245 rows=5,202 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 443kB
18. 8.339 8.339 ↑ 1.0 5,202 1

Seq Scan on d_bp_podstan_produkt d2 (cost=0.00..142.02 rows=5,202 width=39) (actual time=0.004..8.339 rows=5,202 loops=1)

Planning time : 67.859 ms