pls_integer 用法简析

使用场景:简单点说就是在不需要考虑溢出与空的情况下使用,速度会更快,比如计数。
oracle reference :
You can use SIMPLE_INTEGER when the value is never null and overflow checking is unnecessary. Without the overhead of checking for null values and overflow, SIMPLE_INTEGER provides better performance than PLS_INTEGER.


相对于number的优点:简单点说,就是pls_integer 使用的是硬件的算数运算。
oracle reference :
The PLS_INTEGER and BINARY_INTEGER data types are identical and are used interchangeably in this document.
The PLS_INTEGER data type stores signed integers in the range -2,147,483,648 through 2,147,483,647 represented in 32 bits. It has the following advantages over the NUMBER data type and subtypes:
PLS_INTEGER values require less storage.
PLS_INTEGER operations use hardware arithmetic, so they are faster than NUMBER operations, which use library arithmetic.






请使用浏览器的分享功能分享到微信等