explain.depesz.com

PostgreSQL's explain analyze made readable

Result: naLf : Optimization for: plan #6ThT

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 5.060 228.662 ↑ 1.0 319 1

HashAggregate (cost=17,915.38..17,921.76 rows=319 width=48) (actual time=228.607..228.662 rows=319 loops=1)

  • Group Key: (((((round((random() * '50'::double precision)) + '1950'::double precision)))::text || ' - '::text) || a.libelle)
2. 14.874 223.602 ↓ 3.9 16,814 1

Hash Left Join (cost=180.68..17,861.59 rows=4,303 width=40) (actual time=166.951..223.602 rows=16,814 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
3. 4.006 208.629 ↓ 3.9 16,814 1

Hash Join (cost=170.50..17,796.95 rows=4,303 width=20) (actual time=166.834..208.629 rows=16,814 loops=1)

  • Hash Cond: (s.vin_id = v.id)
4. 3.947 202.998 ↓ 3.9 16,814 1

Hash Join (cost=1.11..17,616.25 rows=4,303 width=20) (actual time=165.201..202.998 rows=16,814 loops=1)

  • Hash Cond: (s.contenant_id = c.id)
5. 112.606 199.033 ↓ 3.9 16,814 1

Hash Join (cost=0.04..17,603.64 rows=4,303 width=20) (actual time=165.172..199.033 rows=16,814 loops=1)

  • Hash Cond: ((s.annee)::double precision = ((round((random() * '50'::double precision)) + '1950'::double precision)))
6. 86.417 86.417 ↑ 1.0 860,571 1

Seq Scan on stock s (cost=0.00..13,257.71 rows=860,571 width=16) (actual time=0.057..86.417 rows=860,571 loops=1)

7. 0.005 0.010 ↑ 1.0 1 1

Hash (cost=0.03..0.03 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
8. 0.005 0.005 ↑ 1.0 1 1

Result (cost=0.00..0.02 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=1)

9. 0.012 0.018 ↑ 1.0 3 1

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

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

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

11. 0.840 1.625 ↑ 1.0 6,062 1

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

  • Buckets: 8192 Batches: 1 Memory Usage: 301kB
12. 0.785 0.785 ↑ 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.785 rows=6,062 loops=1)

13. 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
14. 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)