[postgis-users] beginner questions re. SRID

Markus Schaber schabi at logix-tt.com
Fri Oct 21 07:59:34 PDT 2005


Hi, Christomec,

christomec wrote:
> I didn't bother setting my SRID when creating my tables. I thought I'd
> leave it for later, when I better understand this whole projection thing.
> 
> Do you mean to say that having all my SRID's as -1 influences my query
> performance.  I mainly make use of  the following type of queries.

No, this should not influcene your query performance at all.

What I had in mind was having a mixed-SRID geometry column, and then
ussuing queries like:

SELECT * FROM table WHERE setsrid('BOX(0 0, 47 11)'::box2d,4326) &&
transform(table.geom, 4326)

As you have to reproject the geometries individually into the same SRID
as your query bbox, the query planner cannot make any use of the indexes.

If you know that your query areas will always have the same SRID, you
can add a second geometry column to the table containing the already
projected geometries (or even just their bboxes) and then use an index
on it to speed up your query.

Markus



More information about the postgis-users mailing list