Oracle Number Precision Datatype Performance Impact

oracle

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?

Best Answer

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.

Related Question