June 19, 2013

Post: Understanding the maximum number of columns in a MySQL table

MySQL, the defines can still found in the source. Basically, it’s why we can’t have nice things (like default values…can have many more ENUM(‘Y’,'N’) columns, you can only have 255 ENUM columns with unique values. If you …_MAX_N_FIELDS – DATA_N_SYS_COLS * 2) Which adds up to (1024-1)-3*2=1017 which …

Post: Common MySQL traps webinar questions followup

… become a problem if you need to add an ‘unarchived’ status one day). Then each value will take 6 to 8 bytes… value plus 1 byte to store the length of the value). If you make the field an ENUM(‘payed’,'shipped’,'canceled’,'archived’), the values… some subtleties of ENUMs due to their dual nature. Q: Are these recommendations true of all versions of MySQL? If not which…

Post: Hacking to make ALTER TABLE online for certain changes

…) VALUES (‘test’); ERROR 1062 (23000): Duplicate entry ’0′ for key 1 Unfortunately, adding auto_increment does not work that way. Enum values (add and remove). Enumerated values are added and removed the same way that auto… I suppose this does violate mysql data file structure, so be really careful with that one. Default values. MySQL rebuilds table even if…

Post: Intro to OLAP

…(or online analytical processing) tools using MySQL and other free open source software…is a measure. Measures are always aggregated values. That is, total sales might …degenerate dimension is stored as an ENUM in many cases. In the … statuses. Such a dimension would add an extra join, which is …