explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vUMG

Settings
# exclusive inclusive rows x rows loops node
1. 3.367 507.394 ↑ 1.0 319 1

GroupAggregate (cost=60,810.98..60,881.83 rows=319 width=48) (actual time=503.170..507.394 rows=319 loops=1)

  • Group Key: ((((((round((random() * '50'::double precision)) + '1950'::double precision)))::text || ' - '::text) || a.libelle))
  • Planning Time: 1.335 ms
  • Execution Time: 507.539 ms
2. 26.856 504.027 ↓ 3.9 16,840 1

Sort (cost=60,810.98..60,821.72 rows=4,298 width=40) (actual time=503.145..504.027 rows=16,840 loops=1)

  • Sort Key: ((((((round((random() * '50'::double precision)) + '1950'::double precision)))::text || ' - '::text) || a.libelle))
  • Sort Method: quicksort Memory: 2107kB
3. 17.533 477.171 ↓ 3.9 16,840 1

Hash Join (cost=525.06..60,551.61 rows=4,298 width=40) (actual time=6.206..477.171 rows=16,840 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
4. 5.559 459.217 ↓ 3.9 16,840 1

Hash Join (cost=502.14..60,474.28 rows=4,298 width=20) (actual time=5.768..459.217 rows=16,840 loops=1)

  • Hash Cond: (s.vin_id = v.id)
5. 4.551 448.049 ↓ 3.9 16,840 1

Hash Join (cost=81.62..60,042.47 rows=4,298 width=20) (actual time=0.139..448.049 rows=16,840 loops=1)

  • Hash Cond: (s.contenant_id = c.id)
6. 107.570 443.482 ↓ 3.9 16,840 1

Hash Join (cost=0.47..59,949.99 rows=4,298 width=20) (actual time=0.109..443.482 rows=16,840 loops=1)

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

Index Scan using stock_pkey on stock s (cost=0.42..55,609.33 rows=859,527 width=16) (actual time=0.020..335.904 rows=859,527 loops=1)

8. 0.003 0.008 ↑ 1.0 1 1

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

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

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

10. 0.004 0.016 ↑ 400.0 3 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
11. 0.012 0.012 ↑ 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.008..0.012 rows=3 loops=1)

12. 2.257 5.609 ↑ 1.1 6,057 1

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

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

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

14. 0.188 0.421 ↑ 1.0 319 1

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

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

Index Scan using appellation_pkey on appellation a (cost=0.15..18.93 rows=319 width=20) (actual time=0.033..0.233 rows=319 loops=1)