I have a simple query that involves two steps:
- non-spatial criteria (should be super-fast)
- spatial criteria (which is really slow)
I would like to run the spatial query only on the filtered layer (which is only one polygon). Is this possible?
SELECT 31H.* FROM bois_corridor_forestier, 31H
WHERE bois_corridor_forestier.ID="1" /*run this first*/
AND st_intersects(bois_corridor_forestier.geometry, 31H.geometry)