pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Daniel Ceregatti <vi@sh.nu>
Cc: pgsql-performance@postgresql.org
Subject: Re: What is the best way to do attribute/values?
Date: Tue, 24 Aug 2004 22:00:48 +0100
Message-ID: <412BAC80.4050507@archonet.com> (raw)
In-Reply-To: <4124EB58.9040102@sh.nu>
References: <4124EB58.9040102@sh.nu>

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



view thread (9+ messages)  latest in thread

Message-ID: <412BAC80.4050507@archonet.com>
Permalink:  ../412BAC80.4050507@archonet.com/
Also on:    postgresql.org/message-id/412BAC80.4050507@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: dev@archonet.com, vi@sh.nu
  Subject: Re: What is the best way to do attribute/values?
  In-Reply-To: <412BAC80.4050507@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox