reference - MySQL - are there any benefits replacing an INT(11) UNSIGNED with a FK to INT(11) UNSIGNED that is UNIQUE? -


if have table player_res:

+-----------+-------+ | player_id | score | +-----------+-------+ |     1     |   30  | |     2     |   30  | |     3     |   22  | |     4     |   22  | +-----------+-------+ 

would better have score being foreign key referencing lets num.value, num.value being unique? score can appear once in num.value field.

is there advantages in database size and/or speed both types (player_res.score , num.value) int(11)? believe doesn't matter else tried convince me using second table store scores uniquely better performance in case table grow large, that's why decided asking here!

regards

int(11) same size int 4 bytes in mysql. integer types value in parenthesis number of digit displayed. not type size.

http://dev.mysql.com/doc/refman/5.0/en/integer-types.html

using secondary table deduplicate score values doesn't seems serious idea... or , really missing subtleties?


if size issue, might perhaps use smaller integer (like tinyint) store scores?


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -