O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Optimizing datatypes

You should define tables such that they occupy minimum space on disk while accommodating all possible values.

If the size is smaller:

  • Less data is written to or read from the disk, which makes queries faster.
  • The contents on the disk are loaded to the main memory while processing queries. So, smaller tables occupy less space in the main memory.
  • Less space is occupied by indexes.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required