explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w85z : Optimization for: Optimization for: Optimization for: Optimization for: plan #k3S6; plan #oEp; plan #M9nK; plan #Twhz

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 5.110 202.336 ↓ 2.4 10,495 1

GroupAggregate (cost=27,619.07..27,769.61 rows=4,301 width=48) (actual time=196.312..202.336 rows=10,495 loops=1)

  • Group Key: ((((s.annee)::text || ' - '::text) || a.libelle))
2. 52.065 197.226 ↓ 3.9 16,915 1

Sort (cost=27,619.07..27,629.82 rows=4,301 width=40) (actual time=196.301..197.226 rows=16,915 loops=1)

  • Sort Key: ((((s.annee)::text || ' - '::text) || a.libelle))
  • Sort Method: quicksort Memory: 2111kB
3. 6.739 145.161 ↓ 3.9 16,915 1

Hash Left Join (cost=238.19..27,359.50 rows=4,301 width=40) (actual time=6.002..145.161 rows=16,915 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
4. 5.866 138.103 ↓ 3.9 16,915 1

Hash Join (cost=228.01..27,294.87 rows=4,301 width=16) (actual time=5.665..138.103 rows=16,915 loops=1)

  • Hash Cond: (s.vin_id = v.id)
5. 4.109 126.699 ↓ 3.9 16,915 1

Hash Join (cost=37.00..27,092.56 rows=4,301 width=16) (actual time=0.104..126.699 rows=16,915 loops=1)

  • Hash Cond: (s.contenant_id = c.id)
6. 122.574 122.574 ↓ 3.9 16,915 1

Seq Scan on stock s (cost=0.00..27,044.23 rows=4,301 width=16) (actual time=0.074..122.574 rows=16,915 loops=1)

  • Filter: ((annee)::double precision = (round((random() * '50'::double precision)) + '1950'::double precision))
  • Rows Removed by Filter: 843214
7. 0.008 0.016 ↑ 400.0 3 1

Hash (cost=22.00..22.00 rows=1,200 width=8) (actual time=0.016..0.016 rows=3 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
8. 0.008 0.008 ↑ 400.0 3 1

Seq Scan on contenant c (cost=0.00..22.00 rows=1,200 width=8) (actual time=0.006..0.008 rows=3 loops=1)

9. 2.816 5.538 ↑ 1.1 6,058 1

Hash (cost=105.45..105.45 rows=6,845 width=8) (actual time=5.538..5.538 rows=6,058 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 301kB
10. 2.722 2.722 ↑ 1.1 6,058 1

Seq Scan on vin v (cost=0.00..105.45 rows=6,845 width=8) (actual time=0.012..2.722 rows=6,058 loops=1)

11. 0.180 0.319 ↑ 1.0 319 1

Hash (cost=6.19..6.19 rows=319 width=36) (actual time=0.319..0.319 rows=319 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
12. 0.139 0.139 ↑ 1.0 319 1

Seq Scan on appellation a (cost=0.00..6.19 rows=319 width=36) (actual time=0.015..0.139 rows=319 loops=1)