PostGIS alternative bbox filter encoding

Description

Due to a postgis query planner bug (Look here: http://postgis.net/docs/manual-2.0/ch07.html (point 7.1) and here: http://archives.postgresql.org/pgsql-performance/2005-02/msg00030.php) when querying a feature with big geometries using a small bbox filter, the query is very slow.
This is solved changing the current encoded filter from

geometry && ST_GeomFromText(bbox)

to

ST_Envelope(geometry) && ST_GeomFromText(bbox)

the two are equivalent because the && operator already compares envelopes.

Environment

None

Assignee

Mauro Bartolomeoli

Reporter

Mauro Bartolomeoli

Triage

None

Components

Fix versions

Affects versions

Priority

Low
Configure