MySQL: UNIQUE constraint without index

Is it possible to add a restriction like

ALTER TABLE `t1` ADD UNIQUE(`col1`, `col2`);

without creating an index? The index will not be used for any queries, so it will be a waste of space.

It would not be a problem if inserts and updates are slower, because the table is not updated very often.

+4
source share
1 answer

No, It is Immpossible. A UNIQUE constraint contains the definition of an index, and I can barely imagine how it can be implemented without creating an index (in a DBMS).

, "" - , , e.t.c. , .

+6

All Articles