explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oEp : Optimization for: plan #k3S6

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 3.324 504.140 ↑ 1.0 319 1

GroupAggregate (cost=60,829.02..60,899.92 rows=319 width=48) (actual time=499.938..504.140 rows=319 loops=1)

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

Sort (cost=60,829.02..60,839.77 rows=4,301 width=40) (actual time=499.915..500.816 rows=16,829 loops=1)

  • Sort Key: ((((((round((random() * '50'::double precision)) + '1950'::double precision)))::text || ' - '::text) || a.libelle))
  • Sort Method: quicksort Memory: 2105kB
3. 16.817 473.970 ↓ 3.9 16,829 1

Hash Left Join (cost=531.06..60,569.45 rows=4,301 width=40) (actual time=7.502..473.970 rows=16,829 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
4. 4.891 456.755 ↓ 3.9 16,829 1

Hash Join (cost=502.14..60,486.08 rows=4,301 width=20) (actual time=7.073..456.755 rows=16,829 loops=1)

  • Hash Cond: (s.vin_id = v.id)
5. 4.477 444.997 ↓ 3.9 16,829 1

Hash Join (cost=81.62..60,054.26 rows=4,301 width=20) (actual time=0.184..444.997 rows=16,829 loops=1)

  • Hash Cond: (s.contenant_id = c.id)
6. 106.761 440.505 ↓ 3.9 16,829 1

Hash Join (cost=0.47..59,961.77 rows=4,301 width=20) (actual time=0.157..440.505 rows=16,829 loops=1)

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

Index Scan using stock_pkey on stock s (cost=0.42..55,618.08 rows=860,129 width=16) (actual time=0.039..333.732 rows=860,129 loops=1)

8. 0.006 0.012 ↑ 1.0 1 1

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

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

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

10. 0.004 0.015 ↑ 400.0 3 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
11. 0.011 0.011 ↑ 400.0 3 1

Index Scan using contenant_pkey on contenant c (cost=0.15..66.15 rows=1,200 width=8) (actual time=0.007..0.011 rows=3 loops=1)

12. 2.756 6.867 ↑ 1.1 6,058 1

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

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

Index Scan using vin_pkey on vin v (cost=0.28..334.96 rows=6,845 width=8) (actual time=0.020..4.111 rows=6,058 loops=1)

14. 0.184 0.398 ↑ 1.0 319 1

Hash (cost=24.93..24.93 rows=319 width=36) (actual time=0.398..0.398 rows=319 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
15. 0.214 0.214 ↑ 1.0 319 1

Index Scan using appellation_pkey on appellation a (cost=0.15..24.93 rows=319 width=36) (actual time=0.018..0.214 rows=319 loops=1)