explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DyYa

Settings
# exclusive inclusive rows x rows loops node
1. 230.129 887.371 ↑ 12.3 2,498 1

Nested Loop (cost=26,087.06..63,658.87 rows=30,605 width=107) (actual time=353.304..887.371 rows=2,498 loops=1)

  • Join Filter: (_st_distance(geography(u.geo_point), geography(l.geo_point), '0'::double precision, false) <= '1000'::double precision)
  • Rows Removed by Join Filter: 89,539
2. 0.014 0.014 ↑ 1.0 1 1

Index Scan using locations_id_key on locations l (cost=0.28..8.29 rows=1 width=32) (actual time=0.009..0.014 rows=1 loops=1)

  • Index Cond: (id = 3,896)
3. 201.517 657.228 ↓ 1.0 92,037 1

Hash Join (cost=26,086.78..39,090.07 rows=91,815 width=139) (actual time=352.437..657.228 rows=92,037 loops=1)

  • Hash Cond: (upt.user_id = u.id)
4. 103.512 103.512 ↓ 1.0 92,037 1

Seq Scan on user_push_tokens upt (cost=0.00..7,162.82 rows=91,815 width=107) (actual time=0.032..103.512 rows=92,037 loops=1)

  • Filter: (active AND ((app)::text = 'app'::text))
  • Rows Removed by Filter: 62,437
5. 137.223 352.199 ↓ 1.0 195,589 1

Hash (cost=22,114.46..22,114.46 rows=195,546 width=36) (actual time=352.199..352.199 rows=195,589 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 3,563kB
6. 214.976 214.976 ↓ 1.0 195,589 1

Seq Scan on users u (cost=0.00..22,114.46 rows=195,546 width=36) (actual time=0.014..214.976 rows=195,589 loops=1)