* Michael Ruck <[EMAIL PROTECTED]> [2007-04-20 16:15]: > Is there anyone who has experience with this kind of design, do > you have better ideas on modelling this kind of data?
This is actually a very typical approach to storing arbitrarily structured data entities in an SQL database that everyone discovers independently, much like the adjancecy model is the first thing anyone comes up with for storing trees in an SQL database. The problem with this sort of schema (just as with the adjacency model) is that it makes it very hard to formulate any kind of interesting query over the data. You’d need a vendor-specific facility for recursive queries in order to ask anything non- trivial of the database, but such queries are expensive even where supported, which in SQLite they’re not. Essentially, you are reducing the SQL engine to a dumb backend store incapable of complex query logic; complex queries have to be performed in application code after retrieving the entire set of possibly- relevant data. You’re better off using some other kind of data store than an SQL database if you really need storage for that kind of model. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------