types - MySQL char vs. int -


i'm having discussion in class datatypes char , int in mysql. have phone number of 8 individual numbers. however, can't find pros , cons each of them.

should use char type or int type, , why?

if have fixed size can use char(8) -> 8b , mysql works faster fixed size fields, if chose int -> 4b save space , if have index on field work faster char.

you can simple benchmark test speed of writes , reads using char(8) , int

there no point in using variable length type varchar or varbinary if have fixed size because performance decrease


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -