explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TOy8 : Optimization for: plan #bdG2

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 2,276.129 64,273.373 ↑ 49.3 9,124 1

Gather (cost=1,025.00..169,461.87 rows=450,109 width=8) (actual time=4,089.657..64,273.373 rows=9,124 loops=1)

  • Workers Planned: 2
  • Params Evaluated: $1
  • Workers Launched: 2
2.          

Initplan (forGather)

3. 0.010 0.492 ↑ 1.0 1 1

Result (cost=0.48..0.49 rows=1 width=4) (actual time=0.492..0.492 rows=1 loops=1)

4.          

Initplan (forResult)

5. 0.002 0.482 ↑ 1.0 1 1

Limit (cost=0.43..0.48 rows=1 width=4) (actual time=0.481..0.482 rows=1 loops=1)

6. 0.480 0.480 ↑ 5,631,004.0 1 1

Index Only Scan Backward using pk_samples on samples (cost=0.43..252,655.50 rows=5,631,004 width=4) (actual time=0.480..0.480 rows=1 loops=1)

  • Index Cond: (id IS NOT NULL)
  • Heap Fetches: 1
7. 60,752.417 61,996.752 ↑ 61.7 3,041 3

Nested Loop (cost=24.51..123,450.48 rows=187,545 width=8) (actual time=2,552.173..61,996.752 rows=3,041 loops=3)

8. 45.534 45.534 ↑ 1.1 52 3

Parallel Seq Scan on locations l (cost=0.00..10,958.27 rows=58 width=3,240) (actual time=0.153..45.534 rows=52 loops=3)

  • Filter: (location_type_id = 15)
  • Rows Removed by Filter: 66892
9. 302.660 1,198.801 ↑ 1.1 59 155

Bitmap Heap Scan on samples s (cost=24.51..1,938.89 rows=63 width=104) (actual time=1,156.355..1,198.801 rows=59 loops=155)

  • Recheck Cond: (l.boundary_geom && geom)
  • Filter: ((id > $1) AND _st_intersects(l.boundary_geom, geom))
  • Rows Removed by Filter: 64154
  • Heap Blocks: exact=879736
10. 896.141 896.141 ↓ 121.1 68,189 155

Bitmap Index Scan on ix_samples_geom (cost=0.00..24.49 rows=563 width=0) (actual time=896.141..896.141 rows=68,189 loops=155)

  • Index Cond: (l.boundary_geom && geom)
Planning time : 5.923 ms