2

Does number size affect to speed of inserting, updating, ...(DML operations) rows? If i use number(20) instead of number(6), does it impact performance?

migrated from stackoverflow.com Jan 11 at 6:46

This question came from our site for professional and enthusiast programmers.

  • if you have any useful article, please write on comment – Ayubxon Ubaydullayev Jan 10 at 11:24
  • 2
    The size of the column constraint (scale/precision) shouldn't matter; and the size of the number value itself is unlikely to be measurably significant. Do you have a reason to think either does make a difference? – Alex Poole Jan 10 at 12:08
  • Somewhat surprised to see this got migrated. [sqldatatypes] is a recognised tag on StackOverflow so this question was on topic. – APC Jan 11 at 7:30
2

The precision and scale of a number column is a matter for business rules and data modelling. If a number can have values in the trillions don't declare it as number(6).The general cases seem to be

  • leave number columns without further definition - number
  • enforce integer columns e.g. number(20,0) or less commonly integer
  • for cases where it really matters (e.g. monetary values) specify scale and precision e.g. number(15,2)

Then there are the specialized edge cases for binary_float and binary_double. If you are doing heavy-duty calculations there are definite performance benefits from choosing these data types (at the price of losing some exactitude). But if you're using regular number columns just choose the precision and scale you need for the business rules, and don't sweat on performance.

if i define as a number without precision, how it works? what would be default precision?

If we don't define number further there is no default precision. We can store any number from 0.0000000000000000000000000000000000001 to 99999999999999999999999999999999999999.

  • if i define as a number without precision, how it works? what would be default precision? – Ayubxon Ubaydullayev Jan 11 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.