Opened 18 years ago

Closed 16 years ago

#959 closed enhancement (fixed)

Add lco to PostgreSQL driver to have indexes created

Reported by: bartvde@… Owned by: Mateusz Łoskot
Priority: low Milestone: 1.6.0
Component: OGR_SF Version: unspecified
Severity: minor Keywords: PostgreSQL GiST "spatial index"
Cc: Markus Neteler, Mateusz Łoskot

Description (last modified by Mateusz Łoskot)

It would be nice if there would be a layer create option on the PostgreSQL driver to have indexes created automatically.

I would suggest the following indexes:

CREATE INDEX [tablename]_geom_idx
  ON [schema].[tablename]
  USING gist
  (wkb_geometry);

CREATE INDEX [tablename]_oid_idx
  ON [schema].[tablename]
  USING btree
  (oid);

CREATE INDEX [tablename]_ogc_fid_idx
  ON [schema].[tablename]
  USING btree
  (ogc_fid);

And after this do a VACUUM ANALYZE;

Change History (8)

comment:3 by hobu, 17 years ago

Description: modified (diff)
Milestone: 1.5.0

This might be nice for 1.5 if there ends up being a bunch of other PG-related stuff going on this release.

comment:4 by Mateusz Łoskot, 17 years ago

Cc: Mateusz Łoskot added
Description: modified (diff)
Keywords: GiST "spatial index" added

comment:5 by Mateusz Łoskot, 16 years ago

Owner: changed from warmerdam to Mateusz Łoskot
Status: newassigned

If we are going to apply this for 1.5.0. I'm willing to do it.

comment:6 by Mateusz Łoskot, 16 years ago

Keywords: PostgreSQL added

comment:7 by warmerdam, 16 years ago

Priority: highlow

comment:8 by warmerdam, 16 years ago

Milestone: 1.5.0

comment:9 by Markus Neteler, 16 years ago

Cc: Markus Neteler added; neteler@… removed

comment:10 by Even Rouault, 16 years ago

Milestone: 1.6.0
Resolution: fixed
Status: assignedclosed

Commited to trunk in r14212 GIST index creation. The creation of the index is controlled by the SPATIAL_INDEX, turned on by default (like MySQL similar option).

The index on the OGC_FID is created implicitely by the database, because it's a primary key. As far as the OID is concerned, I didn't do anything.

Note: See TracTickets for help on using tickets.