Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6836375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:20:52+00:00 2026-05-26T23:20:52+00:00

Int(11) is 4 bytes, correct? Decimal(5,0) – 5 before decimal and 0 after decimal…

  • 0

Int(11) is 4 bytes, correct?
Decimal(5,0) – 5 before decimal and 0 after decimal… I’m not sure about the number of bytes it takes… (0..99999… 65536 will take two bytes)… So does Decimal(5,0) take 3 bytes then?

What’s better to use if we are talking about performance?

The table is changed manually (once in a while), so there are only SELECTs FROM that table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:20:53+00:00Added an answer on May 26, 2026 at 11:20 pm

    From some preliminary testing, it seems like the storage requirements are actually the same whether you use INT(11) or DECIMAL(5,0). I created 2 tables with the following queries.

    CREATE TABLE Table1(id INT(11));
    
    CREATE TABLE Table2(id DECIMAL(5,0));
    

    After inserting a single value into each table, and running the following for both tables, I saw that the DATA_LENGTH for each row was 7. Inserting additional rows increased the size of either table by 7 bytes.

    SELECT * FROM INFORMATION_SCHEMA.tables where table_name='Table1';
    

    As with all stuff like this, the easiest way to figure it out is to create some tables and verify it. In this case I would just go with INT(11) since it doesn’t seem to require any extra space, and probably requires less processing since Integers are a more primitive data type that the processor can deal with directly. When using DECIMAL, MySQL has to convert the numbers to format that the processor can actually use, probably integer anyway in this case, and there is probably some kind of overhead associated with going back and forth between formats.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Correct me if I am wrong, int is 4 bytes, with a range of
I want to know how to announce int to make sure it's 4 bytes
I use range hader, but not create correct file. if I send Range bytes=0-8999
What is the correct way to work out how many bytes an int is?
I am trying to convert an int into three bytes representing that int (big
An int ( Int32 ) has a memory footprint of 4 bytes. But what
class a { int variable;//4 bytes } class a { static int variable;//? bytes
How can I convert a string of bytes into an int in python? Say
How can I convert from bytes to float in php? Like in Java int
I know that a char and an int are calculated as being 8 bytes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.