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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:34:26+00:00 2026-05-26T22:34:26+00:00

I have a database table with 300 000 records. The most common query done

  • 0

I have a database table with 300 000 records. The most common query done is:

SELECT [..] WHERE `word` LIKE 'userInput%';

At the moment the column type is varchar(50) UNIQUE. I am wondering whether there is a way to optimize the column for this specific query?

Update 2011 11 19 GMT 00:00:

mysql> EXPLAIN SELECT `word_id`, `word` FROM `words` WHERE `word` LIKE 'bar%'
    -> ;
+----+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
| id | select_type | table | type  | possible_keys | key  | key_len | ref  | rows | Extra                    |
+----+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
|  1 | SIMPLE      | words | range | word          | word | 152     | NULL |  435 | Using where; Using index |
+----+-------------+-------+-------+---------------+------+---------+------+------+--------------------------+
  • 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-26T22:34:26+00:00Added an answer on May 26, 2026 at 10:34 pm

    As long as you are using a “starts” with type wild card search, just a standard index should work fine on word.

    It’s only when you start getting into a “contains” wild card search that you start having hard issues with indexing.

    Of course, attaching an explain plan would help…

    Based on the explain plan, it looks like you’re doing about as good as you can do. It’s indicating that it’s using the index properly, and not doing any full table scans or file sorts.

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

Sidebar

Related Questions

I have this database table that contains emails like 300 records, emails{email,name,join_date); and I
I have a table with more than 300,000 records, of size approximately 1.5 GB
I have around 300 records in some table in mysql database. And I have
i have database table like this +-------+--------------+----------+ | id | ip | date |
I have an (access) database table which contains data I would like to populate
I have this homework question: Assume a Database table has 0 records at time
I have a database, there already has 300,000+ rows in it. Now I want
I have a table in database as follows... ID(INT) Values(VARCHAR(50)) 1 200,300 2 100
I have a database table and one of the fields (not the primary key)
I have a database table that i want to allow my friends to update.

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.