pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: silly sad <sad@bankir.ru>
Cc: Lee Hachadoorian <lee.hachadoorian@gmail.com>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Table Design for Hierarchical Data
Date: Wed, 7 Apr 2010 00:17:55 -0600
Message-ID: <k2xdcc563d11004062317g35914f60r49ea20612632b0e3@mail.gmail.com> (raw)
In-Reply-To: <4BBC1B89.5080405@bankir.ru>
References: <n2i5ab13581004061033j4ed25734xd0504cb95a1fc092@mail.gmail.com>
	<4BBC1B89.5080405@bankir.ru>

On Tue, Apr 6, 2010 at 11:43 PM, silly sad <sad@bankir.ru> wrote:
> P.S.
> almost foget, do not try any oracle-like "tree-jouns" or "special types" or
> such a crap.
>
> your problem as plain as to store a pair of integers
> (or numerics (i prefer))

Since it's an identifier and not really a numeric per se, I'd store it
as text.  I mean it could as easily be a 5 character alpha code as 5
character number code.

With tet you can create indexes on substring(idfield,1,1),
substring(idfield,1,2), substring(idfield,1,3),
substring(idfield,1,4), and substring(idfield,1,5) for fast lookups
and matching.



view thread (24+ messages)  latest in thread

Message-ID: <k2xdcc563d11004062317g35914f60r49ea20612632b0e3@mail.gmail.com>
Permalink:  ../k2xdcc563d11004062317g35914f60r49ea20612632b0e3@mail.gmail.com/
Also on:    postgresql.org/message-id/k2xdcc563d11004062317g35914f60r49ea20612632b0e3@mail.gmail.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-sql@postgresql.org
  Cc: scott.marlowe@gmail.com, sad@bankir.ru, lee.hachadoorian@gmail.com
  Subject: Re: Table Design for Hierarchical Data
  In-Reply-To: <k2xdcc563d11004062317g35914f60r49ea20612632b0e3@mail.gmail.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