explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3hmn

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 9.237 140.035 ↓ 2.5 10,611 1

HashAggregate (cost=26,493.73..26,579.79 rows=4,303 width=48) (actual time=137.944..140.035 rows=10,611 loops=1)

  • Group Key: (((s.annee)::text || ' - '::text) || a.libelle)
2. 8.433 130.798 ↓ 3.9 16,978 1

Hash Left Join (cost=180.64..26,439.94 rows=4,303 width=40) (actual time=1.814..130.798 rows=16,978 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
3. 4.086 122.266 ↓ 3.9 16,978 1

Hash Join (cost=170.46..26,375.29 rows=4,303 width=16) (actual time=1.709..122.266 rows=16,978 loops=1)

  • Hash Cond: (s.contenant_id = c.id)
4. 6.801 118.169 ↓ 3.9 16,978 1

Hash Join (cost=169.40..26,346.98 rows=4,303 width=16) (actual time=1.694..118.169 rows=16,978 loops=1)

  • Hash Cond: (s.vin_id = v.id)
5. 109.696 109.696 ↓ 3.9 16,978 1

Seq Scan on stock s (cost=0.00..26,166.28 rows=4,303 width=16) (actual time=0.015..109.696 rows=16,978 loops=1)

  • Filter: ((annee)::double precision = (round((random() * '50'::double precision)) + '1950'::double precision))
  • Rows Removed by Filter: 843593
6. 0.861 1.672 ↑ 1.0 6,062 1

Hash (cost=93.62..93.62 rows=6,062 width=8) (actual time=1.672..1.672 rows=6,062 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 301kB
7. 0.811 0.811 ↑ 1.0 6,062 1

Seq Scan on vin v (cost=0.00..93.62 rows=6,062 width=8) (actual time=0.006..0.811 rows=6,062 loops=1)

8. 0.002 0.011 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=8) (actual time=0.011..0.011 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.009 0.009 ↑ 1.0 3 1

Seq Scan on contenant c (cost=0.00..1.03 rows=3 width=8) (actual time=0.008..0.009 rows=3 loops=1)

10. 0.055 0.099 ↑ 1.0 319 1

Hash (cost=6.19..6.19 rows=319 width=20) (actual time=0.099..0.099 rows=319 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
11. 0.044 0.044 ↑ 1.0 319 1

Seq Scan on appellation a (cost=0.00..6.19 rows=319 width=20) (actual time=0.006..0.044 rows=319 loops=1)