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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:44:41+00:00 2026-05-24T06:44:41+00:00

I have to constantly sort a table by a field that has a decimal

  • 0

I have to constantly sort a table by a field that has a decimal datatype. I have added an index but I am not too sure how effective that is.

Would it be better to store the decimal as an integer, as the precision is not too necessary? Alternatively, I can simply increase the percentage until the smallest percentages can be rounded to more than 1 percent, and then round them, store them as integers, and sort them.

Which is faster, in order, and by how much?
Storing it as integer, with 2 decimal places or with multiple decimal places.

  • 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-24T06:44:43+00:00Added an answer on May 24, 2026 at 6:44 am

    Store it as integers….This would mean that you would have a smaller index for the overlapping numbers as the percentages would go upto 100% and that would mean that lookups would be faster. Decimals are like storing long intergers in binary form.

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

Sidebar

Related Questions

I have a filename that has the following format: timestamp-username-1 This file is constantly
I have a script that constantly segfaults - the problem that I can't solve
I am constantly noticing that I have files checked out for editing that I
I have a WinForms utility that I use constantly, and enhance regularly. Roughly one
I have written a C# app that runs constantly in a loop and several
We have the following table: CREATE TABLE [dbo].[CampaignCustomer]( [ID] [int] IDENTITY(1,1) NOT NULL, [CampaignID]
I have a table with various rows that display data, in each row I
I have a project that needs a sort of shopping cart that is always
I have a NSMutableArray that has 5 values initially set to zero. It contains
I currently have a table of 3m records that needs updating nightly. The data

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.