A concatenated field or multiple fileds

  • Hello listers,

    We are looking for a way to ensure a record is unique. The only way I can think to do it is by creating a unique index on the combination of columns that uniquely represent that record.

    But in this particular case, the combination of column leads to have twelve columns involved. It seems to me that it is very hight.

    Should we create a column that is the concatenation of those twelve columns and build the unique index on that column? Would it be more efficient than having an index on twelve columns?

    Best regards,

    Carl

  • Yes we already have a primary key on that table. The primary key is on one column and this column is not in the list of the column involved in my question.

    Thank's

    Carl

  • If you really want to assure the uniqueness of your 12 columns beside your primary key I'm afrad the only way is a unique contraint (which is a unique index in fact) It wont be very efficient because it is quite large and not too many records are fitting into one single page but I do not see any other possibility.

    Bye

    Gabor



    Bye
    Gabor

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

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