explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uVqAb

Settings
# exclusive inclusive rows x rows loops node
1. 0.206 2.771 ↑ 1.0 1 1

Nested Loop Left Join (cost=343.12..355.21 rows=1 width=32) (actual time=2.764..2.771 rows=1 loops=1)

2. 0.005 0.060 ↑ 1.0 1 1

Nested Loop (cost=0.71..12.76 rows=1 width=20) (actual time=0.054..0.060 rows=1 loops=1)

3. 0.032 0.032 ↑ 1.0 1 1

Index Scan using trip_pkey on trip t (cost=0.43..8.45 rows=1 width=32) (actual time=0.031..0.032 rows=1 loops=1)

  • Index Cond: (id = 10581798)
  • Filter: ((deleted_at IS NULL) OR (deleted_at >= now()))
4. 0.023 0.023 ↑ 1.0 1 1

Index Only Scan using vehicle_pkey on vehicle v (cost=0.28..4.30 rows=1 width=4) (actual time=0.020..0.023 rows=1 loops=1)

  • Index Cond: (id = t.vehicle_id)
  • Heap Fetches: 1
5. 1.109 2.505 ↑ 1.0 1 1

Aggregate (cost=342.41..342.42 rows=1 width=40) (actual time=2.505..2.505 rows=1 loops=1)

6. 1.396 1.396 ↓ 4.0 383 1

Index Only Scan Backward using position_log_vehicle_position_idx on position_log_data (cost=0.56..340.98 rows=95 width=48) (actual time=0.087..1.396 rows=383 loops=1)

  • Index Cond: ((vehicle_id = t.vehicle_id) AND (generated_at >= t.started_at) AND (generated_at <= t.ended_at))
  • Heap Fetches: 383
Planning time : 1.323 ms
Execution time : 2.935 ms