explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SIy

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 3.104 413.943 ↑ 1.0 319 1

GroupAggregate (cost=50,115.01..50,185.96 rows=319 width=48) (actual time=410.006..413.943 rows=319 loops=1)

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

Sort (cost=50,115.01..50,125.77 rows=4,305 width=40) (actual time=409.985..410.839 rows=16,851 loops=1)

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

Hash Left Join (cost=308.59..49,855.16 rows=4,305 width=40) (actual time=23.565..395.728 rows=16,851 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
4. 4.137 382.703 ↓ 3.9 16,851 1

Hash Join (cost=285.67..49,730.00 rows=4,305 width=20) (actual time=23.340..382.703 rows=16,851 loops=1)

  • Hash Cond: (s.vin_id = v.id)
5. 8.777 355.717 ↓ 3.9 16,851 1

Nested Loop (cost=0.60..49,385.81 rows=4,305 width=20) (actual time=0.469..355.717 rows=16,851 loops=1)

  • Join Filter: (s.contenant_id = c.id)
  • Rows Removed by Join Filter: 33702
6. 80.446 346.940 ↓ 3.9 16,851 1

Hash Join (cost=0.47..49,179.91 rows=4,305 width=20) (actual time=0.456..346.940 rows=16,851 loops=1)

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

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

8. 0.004 0.013 ↑ 1.0 1 1

Hash (cost=0.03..0.03 rows=1 width=8) (actual time=0.013..0.013 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.008..0.009 rows=1 loops=1)

10. 0.000 0.000 ↑ 1.0 3 16,851

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

11. 0.006 0.006 ↑ 1.0 3 1

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

12. 1.769 22.849 ↑ 1.0 6,065 1

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

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

Index Scan using vin_pkey on vin v (cost=0.28..209.26 rows=6,065 width=8) (actual time=0.012..21.080 rows=6,065 loops=1)

14. 0.084 0.199 ↑ 1.0 319 1

Hash (cost=18.93..18.93 rows=319 width=20) (actual time=0.199..0.199 rows=319 loops=1)

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

Index Scan using appellation_pk on appellation a (cost=0.15..18.93 rows=319 width=20) (actual time=0.009..0.115 rows=319 loops=1)