Re: Table Design for Hierarchical Data

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: silly sad <sad(at)bankir(dot)ru>
Cc: Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Table Design for Hierarchical Data
Date: 2010-04-07 06:17:55
Message-ID: k2xdcc563d11004062317g35914f60r49ea20612632b0e3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Apr 6, 2010 at 11:43 PM, silly sad <sad(at)bankir(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleas Mantzios 2010-04-07 07:00:14 Re: Table Design for Hierarchical Data
Previous Message silly sad 2010-04-07 05:43:37 Re: Table Design for Hierarchical Data