explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w9cW

Settings
# exclusive inclusive rows x rows loops node
1. 0.119 209.949 ↑ 1.0 1,000 1

Limit (cost=95,638.23..95,908.23 rows=1,000 width=56) (actual time=206.752..209.949 rows=1,000 loops=1)

2. 3.259 209.830 ↑ 25.5 1,000 1

Result (cost=95,638.23..102,536.19 rows=25,548 width=56) (actual time=206.751..209.830 rows=1,000 loops=1)

3. 10.762 206.571 ↑ 25.5 1,000 1

Sort (cost=95,638.23..95,702.10 rows=25,548 width=112) (actual time=206.360..206.571 rows=1,000 loops=1)

  • Sort Key: pl.generated_at DESC
  • Sort Method: top-N heapsort Memory: 314kB
4. 76.085 195.809 ↑ 1.2 21,082 1

WindowAgg (cost=93,598.76..94,237.46 rows=25,548 width=112) (actual time=116.606..195.809 rows=21,082 loops=1)

5. 10.711 119.724 ↑ 1.2 21,082 1

Sort (cost=93,598.76..93,662.63 rows=25,548 width=48) (actual time=116.529..119.724 rows=21,082 loops=1)

  • Sort Key: pl.generated_at
  • Sort Method: quicksort Memory: 2416kB
6. 6.048 109.013 ↑ 1.2 21,082 1

Hash Join (cost=1,611.67..91,728.53 rows=25,548 width=48) (actual time=7.170..109.013 rows=21,082 loops=1)

  • Hash Cond: (pl.position_source_id = ps.id)
7. 97.629 102.950 ↑ 1.2 21,082 1

Bitmap Heap Scan on position_log_data pl (cost=1,610.56..91,376.14 rows=25,548 width=50) (actual time=7.139..102.950 rows=21,082 loops=1)

  • Recheck Cond: ((vehicle_id = 2392) AND (generated_at < '2019-10-23 07:02:22.109+00'::timestamp with time zone))
  • Heap Blocks: exact=10521
8. 5.321 5.321 ↑ 1.2 21,082 1

Bitmap Index Scan on position_log_vehicle_position_idx (cost=0.00..1,604.17 rows=25,548 width=0) (actual time=5.321..5.321 rows=21,082 loops=1)

  • Index Cond: ((vehicle_id = 2392) AND (generated_at < '2019-10-23 07:02:22.109+00'::timestamp with time zone))
9. 0.000 0.015 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=2) (actual time=0.015..0.015 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.015 0.015 ↑ 1.0 5 1

Seq Scan on position_source ps (cost=0.00..1.05 rows=5 width=2) (actual time=0.010..0.015 rows=5 loops=1)

Planning time : 0.298 ms
Execution time : 210.400 ms