explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4JfS

Settings
# exclusive inclusive rows x rows loops node
1. 90.659 639.901 ↓ 2.1 61,170 1

Hash Left Join (cost=30,880.38..67,669.28 rows=29,099 width=323) (actual time=350.926..639.901 rows=61,170 loops=1)

  • Hash Cond: (a.id_produkt = d.id_produkt)
2. 64.359 261.491 ↓ 2.1 61,170 1

Merge Right Join (cost=6,271.97..36,378.56 rows=28,908 width=301) (actual time=63.015..261.491 rows=61,170 loops=1)

  • Merge Cond: (s.id_produkt = a.id_produkt)
3. 138.212 138.212 ↑ 1.0 440,840 1

Index Scan using an_v_sprawy_id_produkt_idx on an_v_sprawy s (cost=0.42..28,499.02 rows=440,840 width=95) (actual time=0.027..138.212 rows=440,840 loops=1)

4. 8.848 58.920 ↓ 2.1 61,170 1

Materialize (cost=6,271.54..6,416.08 rows=28,908 width=214) (actual time=37.038..58.920 rows=61,170 loops=1)

5. 43.351 50.072 ↓ 2.1 61,170 1

Sort (cost=6,271.54..6,343.81 rows=28,908 width=214) (actual time=37.035..50.072 rows=61,170 loops=1)

  • Sort Key: a.id_produkt
  • Sort Method: external merge Disk: 5664kB
6. 6.721 6.721 ↓ 2.1 61,170 1

Seq Scan on subset0 a (cost=0.00..1,165.08 rows=28,908 width=214) (actual time=0.006..6.721 rows=61,170 loops=1)

7. 89.629 287.751 ↓ 1.0 437,662 1

Hash (cost=16,352.44..16,352.44 rows=426,958 width=30) (actual time=287.751..287.751 rows=437,662 loops=1)

  • Buckets: 65536 Batches: 8 Memory Usage: 3984kB
8. 198.122 198.122 ↓ 1.0 437,662 1

Seq Scan on an_v_dluznik d (cost=0.00..16,352.44 rows=426,958 width=30) (actual time=2.989..198.122 rows=437,662 loops=1)

  • Filter: ((id_rola_dluznik = 1) AND (rn = 1))
  • Rows Removed by Filter: 12259
Planning time : 37.929 ms
Execution time : 694.414 ms