Bug ID domain?

Sean McAfee etzwane at schwag.org
Fri Apr 25 22:17:12 UTC 2003

Bradley Baetz <bbaetz at acm.org> wrote:
>On Fri, Apr 25, 2003 at 03:23:27AM -0400, Jason Pyeron wrote:
>> What needs to be done is:
>> do a unique index on (null,val) and have an ID pk not null column.

>Well, you don't need a PK. Have the field id be non-null, and add unique
>constraint on (bug, field).

Like this?

bug_id integer,  -- was "not null"
field_id integer not null,
value integer,
unique key (bug_id, field_id)  -- was "primary key"

I hadn't known that uniqueness was available as a key (ie, something that
speeds up queries), and not just as a constraint.  Back when I did a lot
of Oracle programming, I only ever used uniqueness as a constraint--if
it also functioned as a key in that environment, I wasn't aware of it.

>Think about the 'multiple' bit - there is no PK there since (bug, field)
>isn't unique.

That's true for Selection fields--there's one row per selected value--but
not for the scalar types.

Sean McAfee -- etzwane at schwag.org

More information about the developers mailing list