Re: Schema design question

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Ben <bench(at)silentmedia(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Schema design question
Date: 2008-03-31 07:38:48
Message-ID: 47F09508.7070707@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ben wrote:
> I'm working on a project which requires me to keep track of objects,
> each of which can have an arbitrary number of attributes. Although there
> will be many attributes that an object can have,...
> Anyway, this seems like a common problem without a perfect solution, and
> I'm sure people must have hindsight opinions on how they solved it. Your
> thoughts?

If each attribute can only occur once for any object, and if your
queries are based more on exact matches of the values rather than
range queries, you might want to look into the hstore module:
http://www.postgresql.org/docs/current/static/hstore.html

If attributes can occur more than once, you might even want to
serialize the whole object as some text format (yaml, xml, etc)
instead.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stuart Brooks 2008-03-31 08:03:23 ANALYZE getting dead tuple count hopelessly wrong
Previous Message Allan Kamau 2008-03-31 07:35:47 Removing redundant itemsets