Performance of PL/SQL PLS_INTEGER type

Source: Internet
Author: User


PL/SQL PLS_INTEGER type provides some performance. If PLS_INTEGER is used, oracle uses the native machine algorithm. All other numeric data types are the same as the NUMBER data type. The result of using the C Language Algorithm Library is that the PLS_INTEGER value processing speed is much faster than the NUMBER integer, PLS_INTEGER does not encounter compatibility issues when porting the hardware platform www.2cto.com for intensive integer operations. Think recommends that you use PLS_INTEGER. If the PLS_INTEGER and NUMBER types of data exchange frequently, we recommend that you use NUMBER at the beginning. If you have requirements on precision, do not use it. Because PLS_INTEGER is used for integer calculation, the result will be tested in an experiment as follows: www.2cto.com [SQL] hr @ ORCL> ed Wrote file afiedt. buf 1 DECLARE 2 j PLS_INTEGER: = 0; 3 BEGIN 4 FOR I IN 1 .. 1000000 5 LOOP 6 j: = I + 1; 7 IF j = 1000 8 THEN 9 dbms_output.put_line ('Hello think'); 10 END IF; 11 END LOOP; 12 * END; hr @ ORCL>/Hello Think PL/SQL procedure successfully completed. elapsed: 00:00:00. 28 hr @ ORCL> ed Wrote file afiedt. buf 1 DECLARE 2 j NUMBER: = 0; 3 BEGIN 4 FOR I IN 1 .. 1000000 5 LOOP 6 j: = I + 1; 7 IF j = 1000 8 THEN 9 dbms_output.put_line ('Hello think'); 10 END IF; 11 END LOOP; 12 * END; hr @ ORCL>/Hello Think PL/SQL procedure successfully completed. elapsed: 00:00:00. 36

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.