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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:55:10+00:00 2026-05-26T17:55:10+00:00

Sometimes I am not sure whether using enum or char(1) in MysQL. For instance,

  • 0

Sometimes I am not sure whether using enum or char(1) in MysQL. For instance, I store statuses of posts. Normally, I only need Active or Passive values in status field. I have two options:

// CHAR
status char(1);

// ENUM (but too limited)
status enum('A', 'P');

What about if I want to add one more status type (ie. Hidden) in the future? If I have small data, it won’t be an issue. But if i have too large data, so editing ENUM type will be problem, i think.

So what’s your advice if we also think about MySQL performance? Which way I would go?

  • 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-26T17:55:11+00:00Added an answer on May 26, 2026 at 5:55 pm

    Neither. You’d typically use tinyint with a lookup table

    • char(1) will be slightly slower because comparing uses collation

    • confusion: As you extend to more than A and P

    • using a letter limits you as you add more types. See last point.

    • every system I’ve seen has more then one client eg reporting. A and P have to resolved to Active and Passive for in each client code

    • extendibility: add one more type (“S” for “Suspended”) you can one row to a lookup table or change a lot of code and constraints. And your client code too

    • maintenance: logic is in 3 places: database constraint, database code and client code. With a lookup and foreign key, it can be in one place

    • Enum is not portable

    On the plus side of using a single letter or Enum

    Note: there is a related DBA.SE MySQL question about Enums. The recommendation is to use a lookup table there too.

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

Sidebar

Related Questions

I'm not too sure what is going on here, but sometimes a particular file
Im using HTC Hero with HTS sense. Im experience that sometimes AsyncTask not will
I embed text in textfield, but sometimes it does not render using htmltext. if
I have been using dean edwards ie7/8 script . Not sure if it's my
I am not sure whether this is the right place to ask this question.
I have noticed that MATLAB sometimes displays my colors incorrectly. I'm not sure if
If my code throws an exception, sometimes - not everytime - the jsf presents
I've got a problem in my database - somehow changes sometimes are not being
sometimes i see an image not being served when the browser look at www.somesite.com/some_image.jpg
Sometimes I know a file is not so deep away, but a very dense

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.