Re: Triggers or primary key constraints
Posted in 1999
Dhanesh, Have you tried creating a primary key instead of the unique index. The primary key is a constraint and constraint checking is done by the engine. I think this will keep your uniqueness without the locking problem. Perhaps some one else can comment. Regards, Stephen C Manga Email: Stephen.Manga@dbgroup.co.nz Stephen@quanta.co.nz On Tue, 3 Aug 1999, Dhanesh Kottile Veedu wrote: > Hi all, > > Here is the issue ;; > > Table (col1,col2) > i have 3 indexes in this table > 1. unique index on (col1,col2) > 2. duplicate on col1 > 3. duplicate on col2 > > I have lock contention because of index 1 mainly on updates. > So i was thinking avoiding the unique index and write a trigger for the > uniqueness of the values. I do know the trigger takes more time > as i need to inculde a SELECT statement to check the uniqueness. > > what do you guys think about the overhead of this? I know that this is a > foolish question ...Still, i have to get rid of the unique index but also > have to make sure the uniqueness of data. > > So which one you feel is a better option? or Is there any other way to > accomplish the same > > Thanks in advance. > > Dhanesh > > > > > > > >