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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:33:15+00:00 2026-06-13T22:33:15+00:00

I am adding index to mysql queries and below is the query. SELECT *

  • 0

I am adding index to mysql queries and below is the query.

SELECT * 
FROM 
    JOBSEEKER 
WHERE 
    JOBSEEKER.VCEMAIL='godavary@gmail.com' 
    AND JOBSEEKER.ITJOBSEEKERSTATUS<>5 LIMIT 1

Using EXPLAIN:

*************************** 1. row ***************************
       id: 1
select_type: SIMPLE
    table: JOBSEEKER
     type: ALL
possible_keys: NULL
      key: NULL
  key_len: NULL
      ref: NULL
     rows: 121702
    Extra: Using where
1 row in set (0.00 sec)

I added an index to the table and got the following results:

*************************** 1. row ***************************
       id: 1
select_type: SIMPLE
    table: JOBSEEKER
     type: ref
possible_keys: EMAIL_I
      key: EMAIL_I
  key_len: 103
      ref: const
     rows: 1
    Extra: Using where
1 row in set (0.00 sec)

I see that the key length is very high here, but previously it was nothing/NULL. After indexing query execution time is improved.

Is this fine or should I index ITJOBSEEKERSTATUS as well?

  • 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-13T22:33:16+00:00Added an answer on June 13, 2026 at 10:33 pm

    The key_len property is (as you know) the length of the key used in the index. The NULL value from the original table means that there was no key at all, and therefore no index. In this case, the ‘high’ key value is indicative of the number of bytes it take to index, which will be higher using a string (such as an email address) than with something like an integer ID, for example. Despite the ‘long’ key length, using an index helps MySQL find the correct rows more quickly, which is evidenced by your improved execution time.

    Also, you can see that your query went from ALL (full table scan – slow and usually want to avoid) to ref (better – in this case you are matching just those rows in your WHERE condition in this case).

    A true expert will be able to articulate this better, but the general idea is that it is good 🙂

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

Sidebar

Related Questions

I have following query on a MySQL DB: SELECT * , r.id, x.real_name AS
i am adding data from vba excel using adodb into a mysql database everything
Consider the following two queries: select a.*, c.* from account a join customer c
I have the following query: SELECT location, step, COUNT(*), AVG(foo), YEAR(start), MONTH(start), DAY(start) FROM
So I have following as part of my query SELECT * FROM $table WHERE
I'm trying to write a query that joins a handful of tables from MySQL
Should I be careful adding too many include columns to a non-cluster index? I
I am receiving Invalid Index COM exception when calling Excel.AddIns.Item[0] . Excel.AddIns.Count works all
I have a MySQL table from a third-party application that has millions of rows
I am executing a mysql SELECT statement which takes 30 seconds to run the

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.