1

I am trying to run the following query thousands of times per second to determine which is any polygon contains the passed in point.

SELECT * from areas WHERE poly @> ?

Poly is the name of the polygon field and it has a GIST index on it.

I am wondering if I would see any performance benefit from using PostGIS over the regular postgress geospatial index for this simple query. I am using Amazon RDS to host postgress and with 3 xl read replicas I can only get about 20,000 transactions per second and I need to triple that. I have a webapp that makes the requests to postgres. At 20k tps all the postgress replicas are at 100% cpu.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Aug 11, 2015 at 16:51

1 Answer 1

2

The index in native PostgreSQL is basically the same as that in PostGIS (except for selectivity estimates, where PostGIS is better) so there will be no real performance change on such a simple query. Because you're testing one point/poly combination at a time and not doing any repeats of the same poly in the same query (as would be the case on a spatial join) you won't get any leverage from the PostGIS caching features either. Just eyeballing I'd guess that for your use case there's no benefit, unless the native PostgreSQL point-in-poly implementation is braindead in some way.

answered Aug 12, 2015 at 13:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.