8

I usually come across some questions that include the tag, and I consider that such an expression is redundant, since a KEY constraint (be it PRIMARY, CANDIDATE or ALTERNATE), by its very nature, is supposed to enforce uniqueness of the value (or values) contained in the column (or columns) involved.

To put it another way, employing the term “unique key” is like saying/writing “key key”, “key that/which is a key”, or something of the sort.

Proper KEY tags

DBA.SE has proper tags for KEYs; i.e., and , the one that is missing is , but I do not believe it would be used commonly, so creating it does not seem necessary.

Hence, having appropriate KEY tags available, , being a misnomer, is superfluous in the site.

Synonyms

Taking a look at the tag synonyms page, I noticed that (a) , (b) and (c) are regarded as synonyms.

Some minutes ago, I edited this question and the tag was, unfortunately, changed to automatically.

My request

  • From my point of view, the tag that should show up in the applicable questions is, precisely, , while 1 should be burninated.

  • As for 2, I esteem that it should in fact be a separate tag, because a unique index is a (1) physical structure, while a UNIQUE constraint is a (2) logical construct.

This meta.stackexchange.com post suggests that this kind of request has to be addressed by one or more mods, so please carry out these changes.

I would help

Naturally, if my petition is well received, I would happily help to modify the relevant questions (if possible for a non-moderator user, of course). I could suggest edits to improve the usage excerpts and/or the info of the resulting tags too.


1 Yes, I am well aware that, alas, (i) the “unique key” expression appears in the MySQL official documentation, and that (ii) a designer can set up a UNIQUE constraint by means of the UNIQUE KEY keywords in said database management system (DBMS), but that does not imply that using that term, or the keywords, adds any value to the field of database administration.

2 Yes, (a) a unique index is commonly used as a SQL DBMS mechanism that supports (b) a UNIQUE or (c) a PRIMARY KEY constraint declaration, but that does not mean that they are the same thing —and UNIQUE and PRIMARY KEY constraints could be supported by physical structures other than indexes if the DBMS vendors and/or developers find it convenient—, therefore they should not be confused nor conflated. Besides, a unique index can be used in software products that are quite different from a SQL DBMS, where the notion of a (PRIMARY, CANDIDATE, ALTERNATE) KEY is completely irrelevant.

1 Answer 1

8

Originally, was set as the master for and because it was by far the more popular tag, and the only one with any usage guidance.

There may be semantic differences, but it did seem like the tagged questions were all asking about essentially the same thing. To put it another way, the master tag was enough to help people find questions they could answer, since the subject areas are so similar.

Anyway, I have reversed the synonym so that is now the master for .

If there is no outcry, we will merge the tags in due course (effectively deleting ).

was pretty useless (12 questions). I have made it a synonym of .

Thank you for adding usage guidance and a wiki for .

7
  • Thanks a lot for addressing my request! Sure, I'll work on suggesting usage guidance for unique-constraint. After your intervention, I also have doubts about the utility of unique-index; I believe that mentioning in the unique-constraint usage guidance (or in the larger info) that a unique index is the typical supporting structure for a UNIQUE constraint would be enough, what are your thoughts about that possibility?
    – MDCCL
    Feb 21, 2019 at 15:57
  • A similar approach could be useful for the "unique key" issue, maybe mentioning in the "larger" unique-constraint info that MySQL permits creating a UNIQUE constraint with the aid of the (redundant) UNIQUE KEY keywords; so please let me know what you think about that option too.
    – MDCCL
    Feb 21, 2019 at 15:59
  • Of course, receiving feedback from other DBA.SE users would be very helpful as well, if anyone is interested.
    – MDCCL
    Feb 21, 2019 at 16:00
  • @MDCCL Re: unique-index, yes that's probably sufficient. I'll give it some more thought and see if any other opinions come in. I'm not really expecting people to care very much about it. They haven't so far 🙂
    – Paul White Mod
    Feb 21, 2019 at 20:17
  • Yes, I didn't expect people getting very enthusiastic about these subjects, but I really appreciate that a number of users, including yourself of course, have got involved, e.g., reading and upvoting the Q & A, and reviewing and editing the wiki tag. Dissenting opinions or different suggestions are, and would be, of interest as well. Reversing the tag synonyms is also really appreciated, naturally 🙂.
    – MDCCL
    Feb 21, 2019 at 20:27
  • Thank you for making unique-index a synonym of index, and for all the time and effort you put into all these changes.
    – MDCCL
    Mar 7, 2019 at 19:14
  • @MDCCL No worries.
    – Paul White Mod
    Mar 7, 2019 at 20:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .