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 536145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:47:28+00:00 2026-05-13T09:47:28+00:00

I understand the differences between CHAR and VARCHAR, one being fixed-length and the other

  • 0

I understand the differences between CHAR and VARCHAR, one being fixed-length and the other variable-length, and that if all fields in a row are fixed-length, a table will generally perform better.

However, something that is unclear to me is that if I give VARCHAR a length, such as VARCHAR(500), does this retain the row as fixed-length?

For context, I have clean table with 50 columns, mostly TINYINTs, but I need two columns in this table as VARCHAR, as they will need store up to 500 characters each. The exact length is subject to user input and therefore unknown.

As an additional qualification, I don’t really want to put these VARCHAR fields into a separate referenced table as it produces unnecessary joins and doesn’t fit the expected query patterns very efficiently.

Any help would be appreciated. Thanks.

  • 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-13T09:47:28+00:00Added an answer on May 13, 2026 at 9:47 am

    Obviously no, otherwise it wouldn’t be called variable-length in the first place. What it simply does is put a cap on the maximum length of the strings that you can store inthat column. On other, more trustable database engines, strings which are longer than the max will produce an error, but MySQL just truncates excess data:

    mysql> create table t (a varchar(3));
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> insert into t values ('abc'), ('defgh');
    Query OK, 2 rows affected, 1 warning (0.00 sec)
    Records: 2  Duplicates: 0  Warnings: 1
    
    mysql> select * from t;
    +------+
    | a    |
    +------+
    | abc  |
    | def  |
    +------+
    2 rows in set (0.00 sec)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can understand the difference between a signed char and an unsigned one. But
I am trying to understand the differences between the following 2 connectionstrings. one uses
I'm trying to understand the differences between AMQP and XMPP and among other things
I understand the differences between XML and HTML, but one particular aspect is not
Perhaps the issue here is that I don't fully understand the differences between the
I'm new to rails and I don't understand the differences between the use of
Can you help me understand the practical differences between these two; IList<int> myList =
I am trying to understand the trade offs/differences between these to ways of opening
I understand the differences between fgets() and fgetss() but I don't get the difference
I understand the differences between DFS and BFS, but I'm interested to know what

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.