Processing of large data volumes in Databases

Source: Internet
Author: User


Processing Requirements for a large amount of data in the database: a large amount of product order information is retrieved from the ORACLE database, then written into the document in the specified format, and then parsed to the business management interface in JAVA for users to query and use, write one document for every 100000 records. Method 1: (1) Use a query statement to calculate the number of database records. For example, select nvl (COUNT (*), 0) www.2cto.com INTO: ll_Counts FROM ordering table WHERE filter rules;
(2) then calculate the number of documents required to save these records lFileCount = ll_Counts/100000; lSurplus = ll_Counts % 100000; if (lSurplus> 0) {lFileCount = lFileCount + 1 ;} (3) create all files. (4) traverse the records of the database order table again, and then write each 100000 records into each file created above. This method is simple and clear, because the data volume is large, the database was queried twice, which seriously affected the performance. The execution takes a long time. The second method is to traverse the records of the database order table. The first record of every 100000 records starts to create a file, and then write 100000 records. This method only queries the database once, improving the performance a lot. Author cancan8538

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.