K
K
khodos_dmitry2017-06-18 12:06:26
MySQL
khodos_dmitry, 2017-06-18 12:06:26

Do I need to create an additional AI field id field if there is already another unique field?

Some people definitely recommend adding an auto-incrementing id field.
Why is it bad to create a primary index on a Cyrillic field?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2017-06-18
@Rsa97

An index on a text field will simply consume more resources than on a numeric one. Otherwise, if uniqueness of values ​​is guaranteed, then a textual primary key is perfectly acceptable.

D
d-stream, 2017-06-18
@d-stream

In general, legs grow out of the need to have a unique field. If there is no significant one, then an artificial "uniquelizer" is introduced in the form of an auto-increment field. If the table already has something unique, artificial formation does not make much sense.

K
Konstantin Tsvetkov, 2017-06-18
@tsklab

Why is it bad to create a primary index on a Cyrillic field?
Because many decades of experience of many architects show that the natural key eventually loses its uniqueness. Surrogate - no.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question