PostGIS expects a geometry type parameter when creating a Geometry column and permitted values include GEOMETRY
, POINT
, POLYGON
, etc.
If I choose GEOMETRY
then my Geometry column can store points, lines, polygons, etc, and if I choose POLYGON
then the column can only store polygons. One obvious reason to use a specific geometry type such as POLYGON
is to enforce a type constraint on insert / update.
Has anyone experienced performance gains from using a specific type over a generic type? For example, if I execute an ST_Intersects function against an equivalent number of GEOMETRY
objects and POLYGON
objects should I expect either operation to be faster?
To clarify - at this stage I'm only interested in PostGIS performance and I do not want to consider the cost of any additional complexity required in a database client that may need to handle each geometry type differently.
If I'm able to set aside some time I will attempt to test performance myself, but I would also like to hear anyone else's experience.