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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:27:45+00:00 2026-06-05T06:27:45+00:00

I have following table structure. town: id (MEDINT,PRIMARY KEY,autoincrement), town(VARCHAR(150),not null), lat(FLOAT(10,6),notnull) lng(FLOAT(10,6),notnull) i

  • 0

I have following table structure.

town:

id (MEDINT,PRIMARY KEY,autoincrement), 
town(VARCHAR(150),not null),
lat(FLOAT(10,6),notnull)
lng(FLOAT(10,6),notnull)

i frequently use “SELECT * FROM town ORDER BY town” query. I tried indexing town but it is not being used. So what is the best way to index so that i can speed up my queries.

USING EXPLAIN(UNIQUE INDEX Is PRESENT ON town):

 mysql> EXPLAIN SELECT * FROM studpoint_town order by town \G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: studpoint_town
         type: ALL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 3
    Extra: Using filesort

1 row in set (0.00 sec)

ragards ,
ravi.

  • 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-05T06:27:48+00:00Added an answer on June 5, 2026 at 6:27 am

    Your EXPLAIN output indicates that currently the studpoint_town table has only 3 rows. As explained in the manual:

    The output from EXPLAIN shows ALL in the type column when MySQL uses a table scan to resolve a query. This usually happens under the following conditions:

    […]

    • The table is so small that it is faster to perform a table scan than to bother with a key lookup. This is common for tables with fewer than 10 rows and a short row length. Don’t worry in this case.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following table structure: CREATE TABLE [Report].[MesReport]( [MesReportID] [int] IDENTITY(1,1) NOT NULL,
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL
I have a table structure like the following: table a: id int name varchar
I have following table structure: CREATE TABLE pilot_groups ( id INT PK, name VARCHAR(50),
I have the following table structure ZoneID int ZoneName varchar(50) I need to get
I have the following table structure: EVENT_ID(INT) EVENT_NAME(VARCHAR) EVENT_DATE(DATETIME) EVENT_OWNER(INT) I need to add
I have the following table structure: CREATE TABLE a ( a_id int(10) unsigned NOT
I have the following table structure it might not be a correct structure but
I have the following table structure Key int MemberID int VisitDate DateTime How can

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.