Opened 18 years ago

Closed 17 years ago

#1234 closed defect (fixed)

MapServer/PostGIS query mechanism should use primary key on a table

Reported by: margottid@… Owned by: refractions
Priority: high Milestone:
Component: PostGIS Interface Version: 4.2
Severity: normal Keywords:


After installing PostGIS and importing data from Shapefile, I noticed that CGI 
query/nquery were from 10 to 15 times slower than if I were using shapefiles.

I tried to add many and many indexes on my fields, but solution came from Paul 
Ramsey: adding an oid index.

He also suggested to issue this bug, saying that "the mapserver/postgis query 
mechanism should be upgraded to automatically use the primary key on a table 
if such a key exists."


Change History (1)

comment:1 by mark@…, 17 years ago

Resolution: fixed
Status: newclosed
MapServer will now attempt to determine if a single primary key is set on a
table, if no "using unique" clause is found.  The OID is only used if no unique
clause is provided, AND no primary key (or a multi-column primary key) is found.
Note: See TracTickets for help on using tickets.