explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qTXb : Optimization for: plan #y46a

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 4.247 25.696 ↓ 2.4 948 1

Nested Loop (cost=242.42..2,167.32 rows=402 width=76) (actual time=1.526..25.696 rows=948 loops=1)

2. 0.454 5.769 ↓ 2.4 980 1

Hash Left Join (cost=241.86..688.69 rows=402 width=40) (actual time=1.459..5.769 rows=980 loops=1)

  • Hash Cond: (d.dock_group_id = dg.id)
3. 0.776 4.853 ↓ 2.4 980 1

Nested Loop Left Join (cost=178.66..619.97 rows=402 width=19) (actual time=0.987..4.853 rows=980 loops=1)

4. 0.963 3.097 ↓ 2.4 980 1

Hash Join (cost=178.38..323.52 rows=402 width=19) (actual time=0.983..3.097 rows=980 loops=1)

  • Hash Cond: (va.vehicle_id = v.id)
5. 1.177 1.177 ↓ 1.0 2,119 1

Seq Scan on vehicle_availability va (cost=0.00..133.18 rows=2,118 width=8) (actual time=0.013..1.177 rows=2,119 loops=1)

6. 0.155 0.957 ↑ 1.0 980 1

Hash (cost=166.13..166.13 rows=980 width=11) (actual time=0.957..0.957 rows=980 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 49kB
7. 0.641 0.802 ↑ 1.0 980 1

Bitmap Heap Scan on vehicle v (cost=39.88..166.13 rows=980 width=11) (actual time=0.175..0.802 rows=980 loops=1)

  • Recheck Cond: ((system_id)::text = 'edinburgh-city-bikes'::text)
  • Heap Blocks: exact=49
8. 0.161 0.161 ↑ 1.0 980 1

Bitmap Index Scan on number_must_be_unique_per_system (cost=0.00..39.63 rows=980 width=0) (actual time=0.161..0.161 rows=980 loops=1)

  • Index Cond: ((system_id)::text = 'edinburgh-city-bikes'::text)
9. 0.980 0.980 ↓ 0.0 0 980

Index Scan using dock_pkey on dock d (cost=0.29..0.73 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=980)

  • Index Cond: (va.dock_id = id)
10. 0.146 0.462 ↑ 1.0 631 1

Hash (cost=55.31..55.31 rows=631 width=25) (actual time=0.462..0.462 rows=631 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 44kB
11. 0.316 0.316 ↑ 1.0 631 1

Seq Scan on dock_group dg (cost=0.00..55.31 rows=631 width=25) (actual time=0.008..0.316 rows=631 loops=1)

12. 0.980 15.680 ↑ 1.0 1 980

Limit (cost=0.56..3.66 rows=1 width=40) (actual time=0.016..0.016 rows=1 loops=980)

13. 14.700 14.700 ↑ 9,886.0 1 980

Index Only Scan using position_log_vehicle_position_idx on position_log_data pl (cost=0.56..30,604.51 rows=9,886 width=40) (actual time=0.015..0.015 rows=1 loops=980)

  • Index Cond: (vehicle_id = va.vehicle_id)
  • Heap Fetches: 938