explain.depesz.com

A tool for finding a real cause for slow queries.

Result: hgS

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 19,792.346 45,760.144 ↓ 2.9 2,123,655 1

Sort (cost=28,078,918.96..28,080,757.81 rows=735,537 width=24) (actual time=43,410.638..45,760.144 rows=2,123,655 loops=1)

  • Sort Key: u.username, u.some_ts
  • Sort Method: external merge Disk: 78864kB
2. 1,695.077 25,967.798 ↓ 2.9 2,123,655 1

Seq Scan on test u (cost=0.00..27,977,076.63 rows=735,537 width=24) (actual time=0.111..25,967.798 rows=2,123,655 loops=1)

  • Filter: (5 > (SubPlan 1))
  • Rows Removed by Filter: 82956
3.          

SubPlan (forSeq Scan)

4. 2,206.611 24,272.721 ↑ 1.0 1 2,206,611

Aggregate (cost=12.65..12.66 rows=1 width=0) (actual time=0.011..0.011 rows=1 loops=2,206,611)

5. 22,066.110 22,066.110 ↑ 1.0 1 2,206,611

Index Only Scan using i on test su (cost=0.00..12.65 rows=1 width=0) (actual time=0.010..0.010 rows=1 loops=2,206,611)

  • Index Cond: ((username = u.username) AND (some_ts > u.some_ts))
  • Heap Fetches: 2482901