[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

Learning Database Design and Data Types

I'm learning about database design and have the following question.

If you choose a data type that works but is far larger of a data type then what is actually, will the poor selection of data type negativily  impact the performace of a data base and cause higher memory usage since data types and there values are stored in memory?
  • 2
1 Solution

It's best to choose the most appropriate datatype for your data (obviously), but in the real world, it's often of vanishingly small difference if you don't. On a modern computer, I suspect you'd need to work hard to see a differences between using an INT and a BOOL, even though one is 32 times the size of the other.

The place where it will make slightly more difference, if in using fixed-length vs. variable-length datatypes. Since a table with all fixed-length fields has mathematically knowable row start positions (row X starts at X x row-length-in-bytes bytes from the beginning of the table), it is supposed to make row look ups faster. Again, with a modern system, do your benchmarking. Your gains may be negligible compared to the cost to your design.
compdigit44Author Commented:

Is there software out there can will scan your DB servers do see if it meets best practices / normizaltion standards
compdigit44Author Commented:
Does anyone have any additional thoughts on this.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now