Why most SQL databases allow defining the same index twice?

后端 未结 6 1511
没有蜡笔的小新
没有蜡笔的小新 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

    I can see that some databases prevent duplicate indexes. Oracle Database prevents duplicate indexes https://www.techonthenet.com/oracle/errors/ora01408.php while other databases like MySQL and PostgreSQL do not have duplicate index prevention.

提交回复
热议问题