explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kkG7

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.734 16,631.839 ↑ 1.0 10,000 1

Limit (cost=382,811.43..383,412.94 rows=10,000 width=2,187) (actual time=16,391.167..16,631.839 rows=10,000 loops=1)

2. 173.076 16,631.105 ↑ 604.7 10,000 1

Hash Semi Join (cost=382,811.43..746,523.28 rows=6,046,654 width=2,187) (actual time=16,391.166..16,631.105 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. 73.577 73.577 ↑ 54.7 220,906 1

Seq Scan on tracking_details (cost=0.00..330,152.92 rows=12,093,307 width=2,187) (actual time=0.023..73.577 rows=220,906 loops=1)

4. 543.581 16,384.452 ↓ 2.6 831,105 1

Hash (cost=381,509.35..381,509.35 rows=325,519 width=73) (actual time=16,384.452..16,384.452 rows=831,105 loops=1)

  • Buckets: 1048576 (originally 524288) Batches: 2 (originally 1) Memory Usage: 57345kB
5. 1,216.498 15,840.871 ↓ 2.6 831,105 1

Hash Join (cost=344,513.90..381,509.35 rows=325,519 width=73) (actual time=14,363.455..15,840.871 rows=831,105 loops=1)

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

Seq Scan on trackers (cost=0.00..36,491.54 rows=959,845 width=33) (actual time=0.019..263.514 rows=959,778 loops=1)

7. 420.707 14,360.859 ↓ 2.6 831,105 1

Hash (cost=343,374.58..343,374.58 rows=325,519 width=40) (actual time=14,360.859..14,360.859 rows=831,105 loops=1)

  • Buckets: 1048576 (originally 524288) Batches: 2 (originally 1) Memory Usage: 57345kB
8. 7,623.549 13,940.152 ↓ 2.6 831,105 1

HashAggregate (cost=341,421.46..342,398.02 rows=325,519 width=40) (actual time=13,515.230..13,940.152 rows=831,105 loops=1)

  • Group Key: tracking_details_1.tracker_id
9. 6,316.603 6,316.603 ↓ 1.0 11,286,808 1

Seq Scan on tracking_details tracking_details_1 (cost=0.00..330,152.92 rows=11,268,544 width=40) (actual time=0.022..6,316.603 rows=11,286,808 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 804403
Planning time : 1.932 ms
Execution time : 16,686.653 ms