explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8j8I : slow search

Settings
# exclusive inclusive rows x rows loops node
1. 1.036 43,390.699 ↓ 3,000.0 3,000 1

Limit (cost=0.15..6,829.27 rows=1 width=4) (actual time=6.398..43,390.699 rows=3,000 loops=1)

2. 3,479.625 43,389.663 ↓ 3,000.0 3,000 1

Nested Loop (cost=0.15..6,829.27 rows=1 width=4) (actual time=6.396..43,389.663 rows=3,000 loops=1)

  • Join Filter: (spaces.venue_id = venues.id)
  • Rows Removed by Join Filter: 19,534,049
3. 52.528 52.528 ↓ 4,070.0 4,070 1

Index Scan using v_gix on venues (cost=0.15..8.42 rows=1 width=4) (actual time=0.147..52.528 rows=4,070 loops=1)

  • Index Cond: (lonlat && '0103000020E61000000100000005000000EC7CDD6A14C2FD3F854479C2843F4A40EC7CDD6A14C2FD3FBAB22042634049408A4191C175E200C0BAB22042634049408A4191C175E200C0854479C2843F4A40EC7CDD6A14C2FD3F854479C2843F4A40'::geography)
  • Filter: (_st_distance(lonlat, '0103000020E61000000100000005000000EC7CDD6A14C2FD3F854479C2843F4A40EC7CDD6A14C2FD3FBAB22042634049408A4191C175E200C0BAB22042634049408A4191C175E200C0854479C2843F4A40EC7CDD6A14C2FD3F854479C2843F4A40'::geography, '0'::double precision, false) < '1e-05'::double precision)
  • Rows Removed by Filter: 2
4. 39,857.510 39,857.510 ↓ 1.2 4,800 4,070

Seq Scan on spaces (cost=0.00..6,772.13 rows=3,898 width=12) (actual time=0.004..9.793 rows=4,800 loops=4,070)

  • Filter: ((deleted_at IS NULL) AND (collections && '{1}'::integer[]) AND ((max_state)::text = 'published'::text))
  • Rows Removed by Filter: 14,940
Planning time : 0.289 ms
Execution time : 43,391.376 ms