explain.depesz.com

PostgreSQL's explain analyze made readable

Result: k3S6

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 5.105 198.907 ↑ 1.0 319 1

HashAggregate (cost=21,362.66..21,369.04 rows=319 width=48) (actual time=198.850..198.907 rows=319 loops=1)

  • Group Key: (((((round((random() * '50'::double precision)) + '1950'::double precision)))::text || ' - '::text) || a.libelle)
2. 14.196 193.802 ↓ 3.3 16,854 1

Hash Left Join (cost=238.23..21,298.60 rows=5,125 width=40) (actual time=77.721..193.802 rows=16,854 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
3. 3.863 179.507 ↓ 3.3 16,854 1

Hash Join (cost=228.06..21,223.54 rows=5,125 width=20) (actual time=77.608..179.507 rows=16,854 loops=1)

  • Hash Cond: (s.vin_id = v.id)
4. 3.786 174.070 ↓ 3.3 16,854 1

Hash Join (cost=37.04..21,019.07 rows=5,125 width=20) (actual time=76.024..174.070 rows=16,854 loops=1)

  • Hash Cond: (s.contenant_id = c.id)
5. 98.679 170.274 ↓ 3.3 16,854 1

Hash Join (cost=0.04..20,968.57 rows=5,125 width=20) (actual time=76.001..170.274 rows=16,854 loops=1)

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

Seq Scan on stock s (cost=0.00..15,791.85 rows=1,025,085 width=16) (actual time=0.009..71.586 rows=860,129 loops=1)

7. 0.007 0.009 ↑ 1.0 1 1

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

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

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

9. 0.003 0.010 ↑ 400.0 3 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
10. 0.007 0.007 ↑ 400.0 3 1

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

11. 0.789 1.574 ↑ 1.1 6,058 1

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

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

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

13. 0.054 0.099 ↑ 1.0 319 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
14. 0.045 0.045 ↑ 1.0 319 1

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