Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

When we need to add an attribute to a table (e.g. a table of 350,000 polygons), my instinct is to always recreate the table so that the geometry column is last. I think this is a best practice for optimal performance, but I can't find any source to back this up. All imported shapefiles have the geometry column last, but I don't know if this is for performance reasons or not. I believe column order is important for some database platforms, but I'm not sure it is for PostgreSQL. Does anyone have an opinion?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

No. There is no performance, or reason otherwise, to always, apart from consistency of course, have the geometry column last. I suspect the reason it is last most of the time is just historical due to PostGIS being an add-in rather then a built in shipped feature of PostgreSQL.

Most of the tables I manage have something like:

id integer
the_geom geometry
the rest of the stuff....

You can even have more then one geometry column per table, it is just a PostgreSQL type after all.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.