Opened 8 years ago
Closed 8 years ago
#3598 closed defect (wontfix)
"&&" missing
Reported by: | jidanni | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.2.4 |
Component: | documentation | Version: | 2.2.x |
Keywords: | Cc: |
Description
In file:///usr/share/doc/postgis-doc/postgis.html#idm2251 we see:
We can avoid this by using the && operator to reduce the number of distance calculations required:
SELECT the_geom FROM geom_table WHERE ST_DWithin(the_geom, ST_MakeEnvelope(90900, 190900, 100100, 200100,312), 100)
This query selects the same geometries, but it does it in a more efficient way. Assuming there is a GiST index on the_geom, the query planner will recognize that it can use the index to reduce the number of rows before calculating the result of the ST_distance() function. Notice that the ST_MakeEnvelope geometry which is used in the && operation is a 200 unit square box centered on the original point - this is our "query box". The && operator uses the index to quickly reduce the result set down to only those geometries which have bounding boxes that overlap the "query box". Assuming that our query box is much smaller than the extents of the entire geometry table, this will drastically reduce the number of distance calculations that need to be done.
But there is no "&&".
Change History (2)
comment:1 by , 8 years ago
Milestone: | PostGIS 2.2.3 → PostGIS 2.2.4 |
---|
comment:2 by , 8 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This is a toughy to explain. Internally ST_DWithin has an && built in.