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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:29:18+00:00 2026-06-04T00:29:18+00:00

I recall in Oracle it is possible to index based on a function, e.g.

  • 0

I recall in Oracle it is possible to index based on a function, e.g. SUBSTRING(id,1,8).

Does MySQL support this? If not, is there is any alternative?

  • 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-04T00:29:19+00:00Added an answer on June 4, 2026 at 12:29 am

    No, not in a general sense, I don’t believe even 5.6 (the latest version when this answer was first written) has this functionality. It’s worth noting that 8.0.13 and above now support functional indexes, allowing you to achieve what you need without the trigger method described below.

    If you are running an older version of mysql, it is possible to only use the leading part of a column (this functionality has been around for a long time), but not one starting at the second or subsequent characters, or any other more complex function.

    For example, the following creates an index using the first five characters of a name:

    create index name_first_five on cust_table (name(5));
    

    For more complex expressions, you can achieve a similar effect by having another column with the indexable data in it, then using insert/update triggers to ensure it’s populated correctly.

    Other than the wasted space for redundant data, that’s pretty much the same thing.

    And, although it technically violates 3NF, that’s mitigated by the use of triggers to keep the data in sync (this is something that’s often done for added performance).

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

Sidebar

Related Questions

I recall that there was this one method that could piece together an image,
I want to save/recall an integer array using SharedPreferences . Is this possible?
If I recall correctly, there where at least to desktop programas from sun which
This should be a simple question, but I just can't recall the relevant API.
I know this is simple, I just can't recall the best way to do
I vaguely recall seeing this before in an answer to another question, but searching
Is there a way in Bash to recall the argument of the previous command?
As far I recall the function is JIT'd when it is called second time.
I seem to recall (though can't find any reference now) to one being able
From what I recall of a not too distant past, Javascript interpreters suffered from

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.