Datatype fun…

2007-09-13 at 06:38 am Matthew Yonkovit

Its truely amazing how in mysql datatype changes can make a huge performance benefit. Some common ones, changing doubles to decimals can save 4-7 bytes per column, per row…

See:

http://dev.mysql.com/doc/refman/5.1/en/precision-math-decimal-changes.html

&

http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html

the same can be said for timestamp & date time… datetime takes 8 bytes while a timestamp is only 4 bytes. Packing in these can yeild a huge benefit.

Same can be said switching ip address from a varchar to an int using the inet_aton function.

We have seen in some cases 20% and higher boosts in performance with these.

Leave a Reply