While adding index, it is not necessary for the column values to be distinct. So, in those case what is the Varien_Db_Adapter_Interface which is used in the ->addIndex() function.

Also, what is the exact difference between INDEX_TYPE_INDEX and INDEX_TYPE_UNIQUE since there is no documentation regarding the same.

1 Answer 1



  • INDEX_TYPE_INDEX refers to a normal non-unique index. Non-distinct values for the index are allowed, so the index may contain rows with identical values in all columns of the index. These indexes don't enforce any restraints on your data so they are used only for access - for quickly reaching certain ranges of records without scanning all records.
  • INDEX_TYPE_UNIQUE refers to an index where all rows of the index must be unique. That is, the same row may not have identical non-NULL values for all columns in this index as another row. As well as being used to quickly reach certain record ranges, UNIQUE indexes can be used to enforce restraints on data, because the database system does not allow the distinct values rule to be broken when inserting or updating data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.