explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2rAo

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.008 2,710.251 ↑ 1.0 50 1

Limit (cost=427,303.99..427,458.96 rows=50 width=76) (actual time=2,709.942..2,710.251 rows=50 loops=1)

2. 0.008 2,710.243 ↑ 63.3 50 1

Result (cost=427,303.99..437,113.20 rows=3,165 width=76) (actual time=2,709.940..2,710.243 rows=50 loops=1)

3. 0.005 2,710.235 ↑ 63.3 50 1

Merge Append (cost=427,303.99..437,081.55 rows=3,165 width=68) (actual time=2,709.939..2,710.235 rows=50 loops=1)

  • Sort Key: vehicle_availability_history.created_at DESC
4. 0.327 0.327 ↑ 51.0 50 1

Index Scan using "test HACK BY BERGE, replace me" on vehicle_availability_history (cost=0.56..9,737.02 rows=2,552 width=68) (actual time=0.034..0.327 rows=50 loops=1)

  • Index Cond: (vehicle_id = 1746)
5. 0.071 2,709.903 ↑ 613.0 1 1

Sort (cost=427,303.42..427,304.95 rows=613 width=68) (actual time=2,709.903..2,709.903 rows=1 loops=1)

  • Sort Key: "*SELECT* 2".created_at DESC
  • Sort Method: quicksort Memory: 26kB
6. 0.031 2,709.832 ↑ 34.1 18 1

Subquery Scan on *SELECT* 2 (cost=5,884.85..427,283.06 rows=613 width=68) (actual time=328.343..2,709.832 rows=18 loops=1)

7. 2,584.400 2,709.801 ↑ 34.1 18 1

Bitmap Heap Scan on mutation_log (cost=5,884.85..427,276.93 rows=613 width=68) (actual time=328.342..2,709.801 rows=18 loops=1)

  • Recheck Cond: ((entity_kind)::text = 'Vehicle'::text)
  • Rows Removed by Index Recheck: 3834615
  • Filter: ((deleted_at IS NULL) AND ((entity_id)::integer = 1746))
  • Rows Removed by Filter: 320651
  • Heap Blocks: exact=30450 lossy=251269
8. 125.401 125.401 ↓ 2.6 320,670 1

Bitmap Index Scan on mutation_log_entity_idx (cost=0.00..5,884.69 rows=122,684 width=0) (actual time=125.401..125.401 rows=320,670 loops=1)

  • Index Cond: ((entity_kind)::text = 'Vehicle'::text)
Planning time : 0.211 ms
Execution time : 2,710.302 ms