[postgis-users] new table for every layer a good design idea?

Rashad M mohammedrashadkm at gmail.com
Fri Jan 4 21:59:48 PST 2013


Is it a good design idea to maintain separate tables for each layer in a
PostGIS database?. Every layer is defined by users. A user creates his/her
layer say ATM location. I dont have control over the table definition of
the layers much This makes it impossible to predict fields(attribute fields
and type are not known initially) used in the table/layers. School vs roads
have different geometry and set of attributes.

The problem is traditional databases wont advice for having dynamic tables
very much. Does the same apply to spatial databases?
How to use ORM Database library with postgis table. I am using C++ and
libpq. but would like to change to an ORM model.

If i am using single table for every layer postgis may not work because of
geometry type. or i can have 3 table point, line, polygon and data goes
into the correct table based on geometry type.

Each table contains
layerId,featureId,geomety, data(hstore)
data = field1=>value1, field2=>value2 etcc

i need to use hstore for fields "data" because name/type of attributes are
not known before runntime.

Also layerId will be redundant in the table.
Fo example: a layer with 1Lakh features will have a column layerId 1L times
 which will not be there if I use separate tables for separate layers.


But does adding a new table for every layer may become a bottleneck? BTW, I
am writing a web app



-- 
Regards,
   Rashad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130105/c26fcbbe/attachment.html>


More information about the postgis-users mailing list