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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:12:55+00:00 2026-05-29T23:12:55+00:00

I have a column defined as Number (10,3) and this column is indexed. I

  • 0

I have a column defined as Number (10,3) and this column is indexed. I was wondering if I convert this column to be an integer, will the index perform better on it. I will have to multiple by 10^7 and do a divide by 10^7 in my code for it. But i don’t know if it is necessary?

Thanks,

  • 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-29T23:12:56+00:00Added an answer on May 29, 2026 at 11:12 pm

    It’s almost certainly not going to be an appreciable difference.

    The index may be slightly more compact because the integer representations may be slightly smaller than the fixed point representation. For example, the number 1234 requires 3 bytes of storage while the number 1.234 requires 4 bytes of storage. Occasionally, the reverse will be true and the fixed point value will require less storage, but it’s 100 times more likely that the integer representation will be smaller than the reverse. You can see that yourself by populating a table with the first 1 million integers and the first million integers divided by 1000.

    SQL> create table int_test( int_col number(38,0), fixed_col number(10,3) );
    
    Table created.
    
    SQL> insert into int_test
      2    select level, level/1000
      3      from dual
      4   connect by level <= 1000000;
    
    1000000 rows created.
    
    SQL> select sum(vsize(int_col)) int_col_total_size,
      2         sum(vsize(fixed_col)) fixed_col_total_size
      3    from int_test;
    
    INT_COL_TOTAL_SIZE FIXED_COL_TOTAL_SIZE
    ------------------ --------------------
               3979802              4797983
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select count(*) int_larger_than_fixed
      2    from int_test
      3*  where vsize(int_col) > vsize(fixed_col)
    SQL> /
    
    INT_LARGER_THAN_FIXED
    ---------------------
                     8262
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select count(*) fixed_larger_than_int
      2    from int_test
      3*  where vsize(int_col) < vsize(fixed_col)
    SQL> /
    
    FIXED_LARGER_THAN_INT
    ---------------------
                   826443
    

    While the index is going to be slighly more compact, that would only come into play if you’re doing some extensive range scans or fast full scans on the index structure. It is very unlikely that there would be fewer levels in the index on the integer values so single-row lookups would require just as much I/O. And it is pretty rare that you’d want to do large scale range scans on an index. The fact that the data is more compact may also tend to increase contention on certain blocks.

    My guess, therefore, is that the index would use slightly less space on disk but that you’d be hard-pressed to notice a performance difference. And if you’re doing additional multiplications and divisions every time, the extra CPU that will consume is likely to cancel whatever marginal I/O benefit you might get. If your application happens to do a lot more index fast full scans than the average, you might see some reduced I/O.

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

Sidebar

Related Questions

I have model Products with columns: name, number, description Index defined for this model
I have a column defined like this: <DataGridTextColumn Binding={Binding Path=FileSizeBytes, Mode=OneWay} Header=Size IsReadOnly=True />
I have a table defined like this: Column: Version Message Type: varchar(20) varchar(100) ----------------------------------
I have a result of a query which has BLOB column defined in it.
A table I have no control of the schema for, contains a column defined
I have form with user defined filters ( combobox with column names, combobox with
I have a nvarchar(50) column in a SQL Server 2000 table defined as follows:
I have column that contains strings. The strings in that column look like this:
I have column with varchar values like 022008 that I need to convert into
I have defined a column in SQL to be decimal(4,1), null which means I

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.