geo/geomfn: add point in polygon optimization to st_intersects#62193
geo/geomfn: add point in polygon optimization to st_intersects#62193craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
|
In my local testing, this improved the performance of the benchmark query from https://blog.cleverelephant.ca/2018/09/postgis-external-storage.html from ~55s to ~17s. |
nice! do you have a profile of where time is being spent now? |
bca0f43 to
14af793
Compare
|
14af793 to
0303a71
Compare
otan
left a comment
There was a problem hiding this comment.
i would see if you can make the same optimisations for st_contains and st_within
0303a71 to
ad5f4d5
Compare
I used the same baseline query but changed the function to ST_Contains and ST_Within and the performance of both improves from ~55s to ~12s. Profile for ST_Contains: https://share.polarsignals.com/7a3ba6f/ |
dea6356 to
b13a30b
Compare
otan
left a comment
There was a problem hiding this comment.
Nice.
I've added a few comments to things I've noticed which could improve performance which I missed in the earlier PR.
You should probably have merged that intersects one first and then did this on top, to break up the work a bit! It's okay to break this stuff up and take care of perfection separately. This PR got more difficult factoring in Contains and WIthin and as a result requires cognitive load on top of the first PR to review. Ah well.
b13a30b to
2bbcf05
Compare
This patch improves the performance of st_intersects for the common use case of testing whether a (multi)polygon and a (multi)point intersect. Release note: None
2bbcf05 to
0b5b1ad
Compare
|
Having |
|
bors r=otan |
|
Build failed (retrying...): |
|
Build failed (retrying...): |
|
Build succeeded: |
This patch improves the performance of st_intersects for the
common use case of testing whether a (multi)polygon and a
(multi)point intersect.
Release note: None