I have a PostGIS/Postgresql DB that has two tables in it. One with point geometries and the other that represents country boundaries as polygons. I would like to add the country name that each point intersects with to each row in my point table. Maybe as one big update query. I think this is possible to do using straight SQL but I don't know where to begin. Any advice on this would be greatly appreciated…
[GIS] Update database row with points that fall within polygons
point-in-polygonpostgispostgresql
Best Answer
Another option, without needing the function
I suspect (although I haven't tested) that this will be faster than using a nested function like in your example.
My output from running explain (hopefully your looks similar). If you have got more Seq Scan results, then that is something to look at, perhaps the indexes aren't quite set up properly.