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

  • Home
  • SEARCH
  • 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 8112861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:38:59+00:00 2026-06-06T02:38:59+00:00

I saw comment If you have 50 million values between 10 and 15 characters

  • 0

I saw comment “If you have 50 million values between 10 and 15 characters in a varchar(20) column, and the same 50 million values in a varchar(50) column, they will take up exactly the same space. That’s the whole point of varchar, as opposed to char.”. Can Anybody tell me the reason? See What is a reasonable length limit on person "Name" fields?

  • 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-06-06T02:39:01+00:00Added an answer on June 6, 2026 at 2:39 am

    MySQL offers a choice of storage engines. The physical storage of data depends on the storage engine.

    MyISAM Storage of VARCHAR

    In MyISAM, VARCHARs typically occupy just the actual length of the string plus a byte or two of length. This is made practical by the design limitation of MyISAM to table locking as opposed to a row locking capability. Performance consequences include a more compact cache profile, but also more complicated (slower) computation of record offsets.

    (In fact, MyISAM gives you a degree of choice between fixed physical row size and variable physical row size table formats depending on column types occuring in the whole table. Occurrence of VARCHAR changes the default method only, but the presence of a TEXT blob forces VARCHARs in the same table to use the variable length method as well.)

    The physical storage method is particularly important with indexes, which is a different story than tables. MyISAM uses space compression for both CHAR and VARCHAR columns, meaning that shorter data take up less space in the index in both cases.

    InnoDB Storage of VARCHAR

    InnoDB, like most other current relational databases, uses a more sophisticated mechanism. VARCHAR columns whose maximum width is less than 768 bytes will be stored inline, with room reserved matching that maximum width. More accurately here:

    For each non-NULL variable-length field, the record header contains
    the length of the column in one or two bytes. Two bytes will only be
    needed if part of the column is stored externally in overflow pages or
    the maximum length exceeds 255 bytes and the actual length exceeds 127
    bytes. For an externally stored column, the two-byte length indicates
    the length of the internally stored part plus the 20-byte pointer to
    the externally stored part. The internal part is 768 bytes, so the
    length is 768+20. The 20-byte pointer stores the true length of the
    column.

    InnoDB currently does not do space compression in its indexes, the opposite of MyISAM as described above.

    Back to the question

    All of the above is however just an implementational detail that may even change between versions. The true difference between CHAR and VARCHAR is semantic, and so is the one between VARCHAR(20) and VARCHAR(50). By ensuring that there is no way to store a 30 character string in a VARCHAR(20), the database makes the life easier and better defined for various processors and applications that it supposedly integrates into a predictably behaving solution. This is the big deal.

    Regarding personal names specifically, this question may give you some practical guidance. People with full names over 70 UTF-8 characters are in trouble anyway.

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

Sidebar

Related Questions

i saw comment like this one place i have seen this problem is if
just saw this comment in a what JS lib do you use poll @Xanti
I saw a comment on Ben Nadel's blog where Stephen Rushing posted a loader,
I was reading a forum recently, and saw this comment: So, you see you've
I saw this comment.... http://www.php.net/manual/en/function.mysql-real-escape-string.php#93005 And began to wonder why this would be a
I saw some other similar questions on this topic here but they were not
I have extract the JAR file with winrar, and i able to saw all
I saw a comment on another question (I forget which one) encouraging the asker
Possible Duplicate: Why are Hexadecimal Prefixed as 0x? I just saw a comment a
In my application I have two Master pages and they are used in various

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.