explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zbO9 : Optimization for: plan #kkG7

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.731 13,466.303 ↑ 1.0 10,000 1

Limit (cost=382,809.49..383,411.02 rows=10,000 width=2,187) (actual time=13,178.013..13,466.303 rows=10,000 loops=1)

2. 188.391 13,465.572 ↑ 604.6 10,000 1

Hash Semi Join (cost=382,809.49..746,518.50 rows=6,046,408 width=2,187) (actual time=13,178.012..13,465.572 rows=10,000 loops=1)

  • Hash Cond: (((tracking_details.tracker_id)::text = (trackers.id)::text) AND (tracking_details.datetime = (max(tracking_details_1.datetime))))
3. 101.846 101.846 ↑ 46.3 261,226 1

Seq Scan on tracking_details (cost=0.00..330,151.45 rows=12,092,815 width=2,187) (actual time=0.011..101.846 rows=261,226 loops=1)

4. 490.380 13,175.335 ↓ 2.6 831,105 1

Hash (cost=381,507.42..381,507.42 rows=325,519 width=73) (actual time=13,175.335..13,175.335 rows=831,105 loops=1)

  • Buckets: 1048576 (originally 524288) Batches: 2 (originally 1) Memory Usage: 57345kB
5. 1,207.655 12,684.955 ↓ 2.6 831,105 1

Hash Join (cost=344,511.96..381,507.42 rows=325,519 width=73) (actual time=11,243.290..12,684.955 rows=831,105 loops=1)

  • Hash Cond: ((trackers.id)::text = (tracking_details_1.tracker_id)::text)
6. 236.569 236.569 ↑ 1.0 959,781 1

Seq Scan on trackers (cost=0.00..36,491.54 rows=959,845 width=33) (actual time=0.006..236.569 rows=959,781 loops=1)

7. 471.535 11,240.731 ↓ 2.6 831,105 1

Hash (cost=343,372.64..343,372.64 rows=325,519 width=40) (actual time=11,240.730..11,240.731 rows=831,105 loops=1)

  • Buckets: 1048576 (originally 524288) Batches: 2 (originally 1) Memory Usage: 57345kB
8. 6,081.911 10,769.196 ↓ 2.6 831,105 1

HashAggregate (cost=341,419.53..342,396.09 rows=325,519 width=40) (actual time=10,323.210..10,769.196 rows=831,105 loops=1)

  • Group Key: tracking_details_1.tracker_id
9. 4,687.285 4,687.285 ↓ 1.0 11,286,815 1

Seq Scan on tracking_details tracking_details_1 (cost=0.00..330,151.45 rows=11,268,085 width=40) (actual time=0.006..4,687.285 rows=11,286,815 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 804403
Planning time : 0.779 ms
Execution time : 13,518.048 ms