| From: | Alban Hertroys <alban(at)magproductions(dot)nl> |
|---|---|
| To: | Richard Ollier <r(dot)ollier(at)tequila(dot)co(dot)jp> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Table design - unknown number of column |
| Date: | 2006-11-09 09:56:58 |
| Message-ID: | 4552FB6A.303@magproductions.nl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Richard Ollier wrote:
> Hello,
>
> For a project I have a table containing products and flags.
> The columns of this table are of 2 kinds :
> - Not null data (id, column1, column2)
> - Flags (100 different flags set to 1 or 0)
>
> Over the time the number of flag will increase from 100 to 200 or more.
Having 200 flags as 200 fields... Writing queries on that is going to be
painful.
I would probably look at bitwise operations, although 200 bits is quite
a bit larger than a bigint. Maybe an array of ints would work...
I don't suppose you expect 2^200 different combinations, maybe some of
the flags can be grouped together?
--
Alban Hertroys
alban(at)magproductions(dot)nl
magproductions b.v.
T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede
// Integrate Your World //
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ragnar | 2006-11-09 10:10:40 | Re: Table design - unknown number of column |
| Previous Message | Albe Laurenz | 2006-11-09 09:51:42 | Re: RULE - special variables? |