RS_Intersects, RS_Contains and RS_Within. This can greatly reduce the amount of data that needs to be processed by the application, and thus improve the performance of the application. Spatial filter push-down works for both in-db rasters and out-db rasters.
Spatial Filter Push-down on Partitioned Tables
Raster spatial filter push-down works best on raster tables partitioned by location-related columns. For example, if you have a table containing rasters of different cities, you can partition the table by the city name column, so that the rasters of the same city will be stored in the same partition. This will make the spatial filter push-down more effective. Another example is to partition the table by SRID when the rasters in your table have UTM coordinate reference system and are scattered in different UTM zones. Here is an example of partitioning EuroSAT dataset by SRID to optimize spatial range queries:- Python
- Scala
- Java
Clustering by Raster Columns
Havasu also supports clustering the data by raster columns. This can be achieved by usingCREATE SPATIAL INDEX statement to rewrite the table and cluster the data by the raster column. For example, we can cluster the data in table wherobots.db.test_table by the raster column rast:
- The original table does not have a good column for partitioning.
- The table contains out-db rasters or very small in-db rasters.

