I'm trying to learn how to write geopackage SQL queries so that the r tree index is used, but I can't seem to find any good information. I'm just trying to write a simple query in the qgis db manager like so:
FROM pts, polys,
it takes an extremely long time, but running the same query in qgis using the select by location tool is nearly instant. I figure that the select by location tool must be using a spatial index, while the query is not. I know that spatial indexes must be explicitly included in a geopackage query, but I can not seem to find out how to do so. how do I rewrite this query to use the rtree spatial index?
I am forced by work to use QGIS version 3.12.3 to create and access my geopackages,although running
gdalinfo --version in the OSGeo4W shell indicates I am using GDAL 3.0.4