Why most SQL databases allow defining the same index twice?

后端 未结 6 1524
没有蜡笔的小新
没有蜡笔的小新 2021-01-21 20:09

Why most SQL databases allow defining the same index (or constraint) twice?

For example in MySQL I can do:

CREATE TABLE testkey(id VARCHAR(10) NOT NULL,          


        
6条回答
  •  耶瑟儿~
    2021-01-21 20:39

    There are only two good reasons - that I can think of - for allowing defining the same index twice

    1. for compatibility with existing scripts that do define the same index twice.
    2. changing the implementation would require work that I am neither willing to do nor pay for

提交回复
热议问题