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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:43:20+00:00 2026-06-18T00:43:20+00:00

I found an interesting SitePoint article about indexes in MySQL The above article talks

  • 0

I found an interesting SitePoint article about indexes in MySQL

The above article talks about the “AND” statement, where a “SELECT” like

SELECT peopleid 
FROM people 
WHERE firstname='Mike' 
    AND lastname='Sullivan' 
    AND age=17

can take advantage of a multi-column indexing like

ALTER TABLE people 
    ADD INDEX fname_lname_age (firstname,lastname,age);

But in my web applications I have often a textfield input where the user can type portions of firstname or lastname, resulting in a query like this:

SELECT peopleid 
FROM people 
WHERE ((firstname LIKE '%$parameter%') 
        OR (lastname LIKE '%$parameter%')) 
    AND age=17

So, does the multi-column indexing improve performance also in cases like these?

Thanks in advance

  • 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-18T00:43:22+00:00Added an answer on June 18, 2026 at 12:43 am

    There’s a chapter in the official MySQL manual especially for this.

    But what you really should learn about is EXPLAIN. Put it in front of your query like this:

    EXPLAIN SELECT peopleid 
    FROM people 
    WHERE ((firstname LIKE '%$parameter%') 
            OR (lastname LIKE '%$parameter%')) 
        AND age=17
    

    And you can see if an index is used or not.

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

Sidebar

Related Questions

I found some interesting post about memory usage and CPU usage here on Stack
I found this interesting question about converting numbers into words: Code Golf: Number to
I found an interesting blog post about Go. I am trying to understand the
I found this interesting interface(starts at 33 seconds http://vimeo.com/22946428 ), and would like to
I'm learning Java, coming from C and I found an interesting difference between languages
I just found an interesting article on ajaxian.com. the article is http://blog.dynatrace.com/2011/03/22/testing-and-optimizing-single-page-web-2-0ajax-applications-why-best-practices-alone-dont-work-any-more/ i wonder
In this question I found an interesting detail about scope of a final variable
I found some interesting code when I was looking at things that people had
I found an interesting article at MSDN, which says: ADO makes it possible to
Making a migration from 2.8.1 to 2.9.1 found interesting thing. Tried to write this

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.