explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MOjg

Settings
# exclusive inclusive rows x rows loops node
1. 3.013 411.503 ↑ 1.0 319 1

GroupAggregate (cost=50,089.56..50,160.51 rows=319 width=48) (actual time=407.716..411.503 rows=319 loops=1)

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

Sort (cost=50,089.56..50,100.32 rows=4,305 width=40) (actual time=407.696..408.490 rows=16,846 loops=1)

  • Sort Key: ((((((round((random() * '50'::double precision)) + '1950'::double precision)))::text || ' - '::text) || a.libelle))
  • Sort Method: quicksort Memory: 2108kB
3. 12.833 393.584 ↓ 3.9 16,846 1

Hash Left Join (cost=302.59..49,829.71 rows=4,305 width=40) (actual time=7.078..393.584 rows=16,846 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
4. 4.004 380.379 ↓ 3.9 16,846 1

Hash Join (cost=279.67..49,704.55 rows=4,305 width=20) (actual time=6.678..380.379 rows=16,846 loops=1)

  • Hash Cond: (s.vin_id = v.id)
5. 9.054 369.799 ↓ 3.9 16,846 1

Nested Loop (cost=0.60..49,366.28 rows=4,305 width=20) (actual time=0.080..369.799 rows=16,846 loops=1)

  • Join Filter: (s.contenant_id = c.id)
  • Rows Removed by Join Filter: 33692
6. 89.058 360.745 ↓ 3.9 16,846 1

Hash Join (cost=0.47..49,160.38 rows=4,305 width=20) (actual time=0.068..360.745 rows=16,846 loops=1)

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

Index Scan using stock_pkey on stock s (cost=0.42..44,812.07 rows=861,043 width=16) (actual time=0.016..271.673 rows=861,043 loops=1)

8. 0.005 0.014 ↑ 1.0 1 1

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

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

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

10. 0.000 0.000 ↑ 1.0 3 16,846

Materialize (cost=0.13..12.19 rows=3 width=8) (actual time=0.000..0.000 rows=3 loops=16,846)

11. 0.008 0.008 ↑ 1.0 3 1

Index Scan using contenant_pkey on contenant c (cost=0.13..12.18 rows=3 width=8) (actual time=0.005..0.008 rows=3 loops=1)

12. 2.630 6.576 ↑ 1.0 6,065 1

Hash (cost=203.26..203.26 rows=6,065 width=8) (actual time=6.576..6.576 rows=6,065 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 301kB
13. 3.946 3.946 ↑ 1.0 6,065 1

Index Scan using vin_pkey on vin v (cost=0.28..203.26 rows=6,065 width=8) (actual time=0.013..3.946 rows=6,065 loops=1)

14. 0.158 0.372 ↑ 1.0 319 1

Hash (cost=18.93..18.93 rows=319 width=20) (actual time=0.372..0.372 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..18.93 rows=319 width=20) (actual time=0.011..0.214 rows=319 loops=1)