Skip to content

Instantly share code, notes, and snippets.

@cblavier
Created January 15, 2016 13:31
Show Gist options
  • Save cblavier/726139eda4cd574340bd to your computer and use it in GitHub Desktop.
Save cblavier/726139eda4cd574340bd to your computer and use it in GitHub Desktop.
query plan
Unique (cost=1770.49..1770.50 rows=2 width=4) (actual time=8709.170..9807.342 rows=23681 loops=1)
Buffers: shared hit=2812110, temp read=14269 written=14269
-> Sort (cost=1770.49..1770.50 rows=2 width=4) (actual time=8709.169..9533.428 rows=4428347 loops=1)
Sort Key: locations.id
Sort Method: external merge Disk: 60584kB
Buffers: shared hit=2812110, temp read=14269 written=14269
-> Nested Loop (cost=0.28..1770.48 rows=2 width=4) (actual time=0.044..5979.426 rows=4428347 loops=1)
Buffers: shared hit=2812110
-> Seq Scan on pois (cost=0.00..6.34 rows=187 width=32) (actual time=0.007..0.319 rows=187 loops=1)
Filter: (poi_kind_id = 1)
Buffers: shared hit=4
-> Index Scan using locations_coordinates_index on locations (cost=0.28..9.42 rows=1 width=36) (actual time=0.020..29.736 rows=23681 loops=187)
Index Cond: (coordinates && st_expand(pois.coordinates, '500'::double precision))
Filter: ((pois.coordinates && st_expand(coordinates, '500'::double precision)) AND _st_dwithin(pois.coordinates, coordinates, '500'::double precision))
Buffers: shared hit=2812106
Planning time: 0.160 ms
Execution time: 9812.356 ms
(17 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment