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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:51:44+00:00 2026-05-22T15:51:44+00:00

In my user_accounts table, I have a field called source which is an ENUM

  • 0

In my user_accounts table, I have a field called source which is an ENUM. It indicates how the user was referred to the website. Possible values are via Facebook, via Email, or via regular website signup.

There are 3 possible options for how I can store these values in the database:

  • As a full string, i.e facebook, email , website

  • As a 1 letter code, e.g F, E, W

  • As a 1 number code, e.g 1, 2, 3

Which approach is the best approach from a database performance / maintainence point of view? Is there going to be any impact (such as faster queries) if I stored the values as 1 letter / digit codes rather than as the full strings? This column will be used in WHERE statements.

  • 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-22T15:51:45+00:00Added an answer on May 22, 2026 at 3:51 pm

    Performance wise, ENUMS really tend to the most optimized (As the system knows the possible set of values, it uses different algos in searching etc etc). You can store the full string with ENUMS (‘FACEBOOK’, etc etc) and they will take only 1 byte of space per row! (provided its less than 256 enums in total). However, use enums only if you know for sure that F,E,W are the only options you will see. Adding new ENUMS is a pain as you will have to alter the table to update the enum values, and you will have to ensure the enum order.

    A close second is digits. The issue with that is readability. You may end up having to keep another table to understand what each digit stands for. (Either in the database or in the application)

    Varchar is the worst when it comes to speed of query, but is the most readable and managable.

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

Sidebar

Related Questions

In my application I have an extended User model called UserProfile. This user can
I have to lock user accounts in Active Directory programmatically in C#. Unfortunately it
I have a program that creates a Windows user account using the NetUserAdd() API
I've got a simple routine that populates a record in a table. I have
How do I get a list of domain user accounts with win32 api? In
I am starting to build a new web application that will require user accounts.
When querying with LDAP against our Active Directory structure to look up user accounts,
Trying to create a user account in a test. But getting a Object reference
How can I create a local user account using .NET 2.0 and c# and
How can you get a user token from Logonuser for a user account with

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.