Hi all, I am trying to query the total number of building for each German postcode. I am using the the center point of the buildings and postcode shape files. There are around 26 Mil buildings and around 8K postcodes. I am using the most simplest shape file (less points) but the search still takes days. Although, ST_Within performs faster than ST_Intersects it still takes 0.24 seconds for one search. 26 Mil will take weeks. Any suggestions to improve the performance or alternative solutions? My sql is below. Thanks. SELECT a.osm_id b.plz FROM building_check a LEFT JOIN plz_test b on ST_Within(a.geo, b.geom); |
Not informative, you need to add more info: "hat indexes are placed on the tables? What does a query plan look like? Also this is a generic PostGIS query & may be more appropriate for GIS StackExchange.