Why is player ID data type binary instead of INT?
TomLewis opened this issue ยท 2 comments
I decided to open up my database via Sequel Pro on OSX, and noticed a lot of the data in banmanager tables scrambled, looking deeper the data types for some columns is bloody binary!? is there a reason you are storing player ID's as binary data type instead of INT?
Yes, it's not possible to represent a UUID as an integer.
It's stored as binary to optimise storage space as well as provide a very fast index for lookups.
You can convert the data to human readable strings through the HEX
and UNHEX
functions in MySQL.
SELECT HEX(player_id) AS id, player_name FROM bm_players WHERE player_id = UNHEX('player-uuid-here');