Wednesday, 15 April 2015

mysql - Store abbreviation or complete label? -



mysql - Store abbreviation or complete label? -

for illustration store windows 8 have 3 options.

1) wi8 2) windows 8 3) win 8

i not sure best. column indexed , utilize group by on it. output result need windows 8. table many insert per second. performance important.

in relational databases context, there 2 types of primary keys:

a natural key key formed of attributes exist in real world: social security number, zip code, total name...

a surrogate key unique identifier not derived application data: correlative integer, uuid...

natural keys have bad habit of changing in time , adds horrible maintenance burden. and, in case, don't have clear candidate, since many aliases of real world value expected. there's little reason utilize natural keys in illustration describe.

in mysql, standard way generate surrogate keys in auto_increment feature.

(please note basic concept must familiar no matter plan do. performance issues in mass inserts different story , must addressed @ different levels.)

mysql sql

No comments:

Post a Comment