Intersections on spatial datasets are slow. Inspired by this question intersection in postgis takes hours and hours to run, why? and Paul's post here, https://blog.cleverelephant.ca/2019/11/subdivide.html I made a little test to see if a dataset is going to be a problem. This query should return a value % of the how much of the area of interest that the largest polygon occupies. Presumably much of the dataset also has polygons of similar size.
SELECT concat(ROUND(MAX(ST_Area(Box2D(geom)))::NUMERIC / ST_Area(ST_Extent(geom))::NUMERIC*100,0),' %') AS max_feature
FROM spatial.table
;
If the dataset returns a large percent, there is going to be little benefit of the spatial index, reducing search efficiency. How can I also test for complexity (which presumably creates a processing cost)?. And ideally create some proxy indicator of processing time?