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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:50:43+00:00 2026-05-25T22:50:43+00:00

A thought experiment: You have a CMS that allows users to upload an image,

  • 0

A thought experiment:

You have a CMS that allows users to upload an image, and each page is stored as a row in the database. When a user
uploads an image, it is converted into a base64 encoded string. The
upload script then alters an ENUM column in a table and adds the base64 encoded
string as an allowed enumerable value.

In the front-end of the CMS, a SELECT statement be run on the page and the value of the ENUM column would be used to render out the image using a data
url
.

Would writing a select statement in which the WHERE clause was matching against an enum value have any performance advantage over a query in which the WHERE clause was matching against a varchar column?

…And for the record, I know this is an absolutely terrible design for a CMS. I’m more interested in learning how MySQL would suffer (or thrive) with this setup.

  • 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-25T22:50:43+00:00Added an answer on May 25, 2026 at 10:50 pm

    enum storage is actually just the index of the value you’re storing the field. so you wouldn’t be storing the base64 data, just its associated index in whatever parallel table mysql stores the enum values in.

    however, consider that the actual SQL query strings will have to contain the full base64 data, so you’re needlessly increasing the size of the query string. Consider that a single pixel jpeg is still (around) 119bytes, and in base64 form takes up 160 characters. That’s probably 150+ characters of wasted space. For even moderately sized images, your query strings would be even larger and could quite easily exceed mysql’s max_allowed_packet setting.

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

Sidebar

Related Questions

Say I have two tables, user and comment . They have table definitions that
Note: I have no intention of implementing this, it's more of a thought experiment.
Please note that this is just a thought experiment. I know global (static) vars
I thought it would be a cool experiment to have a for loop and
I thought I heard that py2exe was able to do this, but I never
I thought that there was some way in .net 3.0 to give an array
<disclaimer> What follows is the fruits of a thought experiment. What I'm doing isn't
I have a question about __class__ in python. The documentation says that __class__ is
I have made a simple, test program to experiment using classes. It creates a
I always thought that an if statement essentially compared it's argument similar to ==

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.