Hi Brad,

> create table entity (
>       ent_id          number primary key,
>       ent_name        varchar(50)
> );
> 
> create table nameval (
>       nv_id           number primary key,
>       nv_ent_id       number,
>       nv_name         varchar(50),
>       nv_val          varchar(50)
> );

That is what i prefered if i knew i have to store only char-values.
The question is, if type-casting all values to char is more or less
performant than wasting space by lots of emtpy fields.

Currently i think, having a third table and one for each datatype
will lead to some more joins and selects for getting the data,
but it may be the clearest solution:

create table entity (
        ent_id  number primary key,
        ent_name        varchar(50)
);

create table valtypes (
        vt_id           number primary key,
        vt_name varchar(50)
        vt_type enum( "int", "longint",,,, )
);

create table vals_int (
        v_id            number primary key,
        vt_id           number 
        v_val           int
);

create table vals_char (
        v_id            number primary key,
        vt_id           number
        v_val           varchar(100)
);

...and one more table for each other datatype used. It's just
that each more select takes more time:(

Thanks,

TomH



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to