Filtering
Identifying relationships between geometries, such as distance, intersections, and containment, requires cartesian joins that typically require extensive calculations. When the tables involved contain large numbers of objects, this can result in long execution times. In such cases, to improve performance, you can use filters to reduce the number of objects that need to be processed.
Sometimes, the data required by a filter is already available in a table. For example, in a table of geospatial objects that contains the postal code of each object, you might employ a filter to compare only objects that share the same postal code. However, if the data needed for filtering is not available, it can be calculated and added to an additional column or table. Numeric values that represent the geometries can be based on either a bounding box or a geohash. You can then add predicates to your queries to filter data based on these values. Doing this might require using unique keys for entries in spatial tables.