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?
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
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:
You can even have more then one geometry column per table, it is just a PostgreSQL type after all. |
|||
|
|