Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Use ST_DWithin in where clause #213

Closed
louischan-oursky opened this issue Oct 28, 2016 · 0 comments
Closed

Use ST_DWithin in where clause #213

louischan-oursky opened this issue Oct 28, 2016 · 0 comments
Assignees

Comments

@louischan-oursky
Copy link
Contributor

louischan-oursky commented Oct 28, 2016

Use ST_DWithin(p1, p2, d) (http://postgis.net/docs/ST_DWithin.html) which automatically makes use of index available on the column to replace the expression ST_Distance_Sphere(p1, p2) < d

@cheungpat cheungpat self-assigned this Nov 2, 2016
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Nov 8, 2016
Previously, predicate comparing distance were always compared using
`ST_Distance_Sphere`. Using `ST_DWithin` is better for comparing
where a location is within a certain distance because the latter
make use of available indexes.

While skygear-server does not create indexes on location field
automatically. Developer can add index to columns on their own.

refs SkygearIO#213
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Nov 8, 2016
Previously, predicate comparing distance were always compared using
`ST_Distance_Sphere`. Using `ST_DWithin` is better for comparing
where a location is within a certain distance because the latter
make use of available indexes.

While skygear-server does not create indexes on location field
automatically, advance developer can add index to columns
on their own.

refs SkygearIO#213
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Nov 8, 2016
Previously, predicate comparing distance were always compared using
`ST_Distance_Sphere`. Using `ST_DWithin` is better for comparing
where a location is within a certain distance because the latter
make use of available indexes.

While skygear-server does not create indexes on location field
automatically, advance developer can add index to columns
on their own.

refs SkygearIO#213
rickmak pushed a commit that referenced this issue Nov 9, 2016
Previously, predicate comparing distance were always compared using
`ST_Distance_Sphere`. Using `ST_DWithin` is better for comparing
where a location is within a certain distance because the latter
make use of available indexes.

While skygear-server does not create indexes on location field
automatically, advance developer can add index to columns
on their own.

refs #213
@rickmak rickmak closed this as completed Nov 9, 2016
@rickmak rickmak removed the In Review label Nov 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants