IGNORE_DUP_KEY on index

  • is there a down side to setting IGNORE_DUP_KEY=ON when creating unique nonclustered index?

  • I'd say that not getting an error when you insert a duplicate is the only downside.  If your application doesn't care about that then you should be fine.

     

  • No, we don't care about the error.  We are bulk loading from a file and don't want the load to stop if there are duplicates.  Developers suggested adding IGNORE_DUP_KEY as quick and easy solution instead of having to load record by record from the file and then having to check for existance.  However, DBAs are not agreeing with it and seeing it as a bandage.  So wanted to know if there is a performance hit or any downside to do this.

  • I agree that it is a bandage.

    Using the IGNORE_DUP_KEY skips the records that would create duplicates with a warning "Duplicate key was ignored.".  It should be carefully considered but if your functionality requires it I wouldn't be afraid of the performance impact because I can't think of a reason why there would be one.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply