do not use index when searching in large areas

This concerns viewboxes as well as radius search.
This commit is contained in:
Sarah Hoffmann
2023-08-12 16:12:44 +02:00
parent fa3ac22a8f
commit cab2a74740
4 changed files with 22 additions and 4 deletions

View File

@@ -66,7 +66,15 @@ class Geometry(types.UserDefinedType): # type: ignore[type-arg]
def ST_DWithin(self, other: SaColumn, distance: SaColumn) -> SaColumn:
return sa.func.ST_DWithin(self, other, distance, type_=sa.Float)
return sa.func.ST_DWithin(self, other, distance, type_=sa.Boolean)
def ST_DWithin_no_index(self, other: SaColumn, distance: SaColumn) -> SaColumn:
return sa.func._ST_DWithin(self, other, distance, type_=sa.Boolean)
def ST_Intersects_no_index(self, other: SaColumn) -> SaColumn:
return sa.func._ST_Intersects(self, other, type_=sa.Boolean)
def ST_Distance(self, other: SaColumn) -> SaColumn: