Re: What is the best way to do attribute/values?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Daniel Ceregatti <vi(at)sh(dot)nu>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: What is the best way to do attribute/values?
Date: 2004-08-24 21:00:48
Message-ID: 412BAC80.4050507@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Daniel Ceregatti wrote:
> Hi list,
>
> I have a database with 1M "people" in it. Each person has about 20
> attributes, such as height, weight, eye color, etc. I need to be able to
> search for people based on these attributes. A search can be conducted
> on one attribute, all attributes, or any number in between. How would
> _you_ do this?
>
> I have already attempted to answer this. My attempts are detailed here:
>
> http://sh.nu/email.txt

Hmm... interesting.

Shot in the dark - try a tsearch2 full-text index. Your problem could be
translated into searching strings of the form
"hair=black eyes=blue age=117"

Not pretty, but might give you the speed you want.
--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Mischa Sandberg 2004-08-25 05:28:42 Equivalent praxis to CLUSTERED INDEX?
Previous Message Josh Berkus 2004-08-24 20:30:32 Re: What is the best way to do attribute/values?