explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HquN : Optimization for: Optimization for: plan #k3S6; plan #oEp

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 5.053 472.323 ↓ 2.4 10,526 1

GroupAggregate (cost=69,441.86..69,592.40 rows=4,301 width=48) (actual time=466.260..472.323 rows=10,526 loops=1)

  • Group Key: ((((s.annee)::text || ' - '::text) || a.libelle))
2. 55.360 467.270 ↓ 3.9 16,802 1

Sort (cost=69,441.86..69,452.62 rows=4,301 width=40) (actual time=466.249..467.270 rows=16,802 loops=1)

  • Sort Key: ((((s.annee)::text || ' - '::text) || a.libelle))
  • Sort Method: quicksort Memory: 2103kB
3. 8.028 411.910 ↓ 3.9 16,802 1

Hash Join (cost=549.22..69,182.29 rows=4,301 width=40) (actual time=11.884..411.910 rows=16,802 loops=1)

  • Hash Cond: (s.vin_id = v.id)
4. 4.276 392.307 ↓ 3.9 16,802 1

Hash Join (cost=81.58..68,612.50 rows=4,301 width=16) (actual time=0.283..392.307 rows=16,802 loops=1)

  • Hash Cond: (s.contenant_id = c.id)
5. 388.012 388.012 ↓ 3.9 16,802 1

Index Scan using stock_pkey on stock s (cost=0.42..68,520.01 rows=4,301 width=16) (actual time=0.250..388.012 rows=16,802 loops=1)

  • Filter: ((annee)::double precision = (round((random() * '50'::double precision)) + '1950'::double precision))
  • Rows Removed by Filter: 843327
6. 0.008 0.019 ↑ 400.0 3 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
7. 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)

8. 3.233 11.575 ↑ 1.1 6,058 1

Hash (cost=382.08..382.08 rows=6,845 width=36) (actual time=11.574..11.575 rows=6,058 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 377kB
9. 4.747 8.342 ↑ 1.1 6,058 1

Hash Left Join (cost=29.20..382.08 rows=6,845 width=36) (actual time=0.454..8.342 rows=6,058 loops=1)

  • Hash Cond: (v.appellation_id = a.id)
10. 3.179 3.179 ↑ 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.019..3.179 rows=6,058 loops=1)

11. 0.198 0.416 ↑ 1.0 319 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
12. 0.218 0.218 ↑ 1.0 319 1

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