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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:50:19+00:00 2026-06-14T03:50:19+00:00

A partial index helps to have smaller indexes, and makes INSERTs faster. For instance

  • 0

A partial index helps to have smaller indexes, and makes INSERTs faster.

For instance

  CREATE TABLE wine (
    name VARCHAR(100),
    ...
    INDEX (name(8)));

While names are something like

  Chateau Mouton-Rothschild
  Chateau Mouton-Cadet
  Chateau Petrus
  Chateau Lafite
  Chateau Lafleur
  ...

In this (example) list, Chateau appears all the time, MySQL creates an index based on the 8 first characters… meaning there will be only one entry in the index (and the search of Chateau Petrus will be done sequentially for all Chateau).
(In this very case, a split between the first word (Chateau) and the rest of the name in two fields would make sense, but this is not the point).

Is there a way to ask MySQL to create a partial index based on the end of a field?

  • 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-14T03:50:21+00:00Added an answer on June 14, 2026 at 3:50 am

    Actually I found a way in the meantime – with a bit of programming:

    Only for the name field

    • all name entries are stored reverse in the DB
    • all name searches are made reverse
    • name in row is reversed before being sent to client (user agent)

    For instance in PHP

    • ...query('INSERT ... name="' . strrev($name) . '"...
    • ...query('SELECT * FROM wine WHERE name="' . strrev($name) . '"');
    • and for instance a search of %MOUTON% will actually search %NOTUOM%

    There is a bit of reverse overhead, but is negligible compared to the possible database gain.

    The question was specifically asking for a pure MySQL solution, but if there is none, this is a workable workaround in any language. I’ll accept this answer in a few days if there is nothing better.

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

Sidebar

Related Questions

In my rails view(index.html.erb), i have following structure <div> <%= render :partial => create
I have in my app/views/bar/index.html.haml the following %p= render partial: 'foo', collection: @foos the
I have a partial view of a row for the table. Each row in
I have a table of venue records which are being displayed on the index
so i have a problem with :partial rendering... I have: index.html.erb view with content
I have a partial view that I'm using on my index page to display
I need to search for a partial match in an inverted index, following code
I have two partial view and I want to call one of them in
I have a partial view that upon adding an item to the database needs
I have an index page for listing products. From this page I would like

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.