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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:55:19+00:00 2026-05-27T10:55:19+00:00

Does MySQL make use of any indexes when using the ROUND() function? Consider this

  • 0

Does MySQL make use of any indexes when using the ROUND() function?

Consider this query:

SELECT CPRID,ROUND(Dist*1000) AS `Distance` 
FROM CPRaw_ID1 
GROUP BY ROUND(1000*Dist) 
ORDER BY ROUND(Dist*1000)

Will MySQL Still use my Index on the Dist column?

  • 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-27T10:55:20+00:00Added an answer on May 27, 2026 at 10:55 am

    First you can use EXPLAIN to see whether index on Dist will be used in the query. I did an experiment and found out that is not.

    Actually, an sugguestion is avoid using functions in where clause. Also, this explained how mysql uses indexes.

    In the query you post, I think you can try to create another table and put the result of the query:

    SELECT CPRID,ROUND(Dist*1000) AS `Distance` 
    FROM CPRaw_ID1
    

    into that temporary table and build index on Distance. Then the index will be used to accelerate the query.

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

Sidebar

Related Questions

Does anybody know if there is a way to make autocompletion work in MySQL
when $query = 'SELECT * FROM users'; and there are multiple columns/rows, does mysql_fetch_assoc($result)
Why does the MySQL query below give error 1066 (Not unique table/alias: 'customer') ?
I have using mysql 5.1 with cpanel /whm centOS. I had to use trigger
Now I have my website built on PHP & Mysql. Consider this like a
I want to make a compound query into MySQL. If the first part of
I am creating a scheduler using PHP/MySQL where I have to allow the use
Does MySQL index foreign key columns automatically?
Does MySQL support MSDTC?
Does MySQL come with a built-in automatic failover? Or, are there load-balancers out there

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.