Subject Re: [ib-support] Unique constraint not an index? was Re: Error:Object is in use
Author Jörg Schiemann
> At 04:03 PM 23-02-01 +0100, you wrote:
> >Helen Borrie wrote:
> >
> > > No. The unique constraint isn't an index, so it won't cause problems
for the optimizer.
> > >
> > > >I still don't know if IB creates an index on unique, I think so, but
I'm not
> > > >sure.
> > >
> > > No, it doesn't...well, it kinda does...but it's an internal structure
and it won't be used by the optimizer for joins.
> > >
> >
> >Are You sure?
> >I created the table with a unique constraint and if I look with IB_WISQL
> >it shows me
> >an unique index on ORDER_ID, ORDER_POS
> >and an index on ORDER_ID
>
> This could be an anomaly in IB_WISQL or a bug introduced by IB 6 or...Ann?
>
> Try checking the output of this query:
>
> select rdb$index_name, rdb$relation_name from rdb$indices
> where rdb$relation_name = 'PARTS'

RDB$INDEX_NAME RDB$RELATION_NAME
=============================== ===================

RDB$PRIMARY21 PARTS
RDB$FOREIGN22 PARTS
RDB$23 PARTS
IDX_DRAFT_NO PARTS

RDB$23 is the unique constraint.

Regards,
Jörg Schiemann