C # implement full-Database SQL data retrieval-compare the efficiency of using DataReader with DataAdapter + able, with an astonishing gap!

Source: Internet
Author: User

For the purpose of the project, you often need to know the tables in which a value has appeared, and then analyze the execution process and processing logic of the program. We usually use the SQL event tracker. This tool is rarely used, but it is often overwhelmed by the large number of events tracked during use.

As a result, I made a given value, which can query any field in any table with the same value, specify the corresponding table and field, such as an SQL full database retrieval tool.

In the first version, I used DataAdapter + able. At this time, the query time was very serious, and the calculation started in the morning until noon was only in the collection statement phase!

Even if I change the server with higher configurations for execution, it is almost intolerable to increase the speed by three to five times. Then modify the code and use DataReader to replace the previous DataAdapter + able. When the previous program was still running, it took about one minute to complete the statement collection process.

The statement verification process takes less than 10 minutes!

Note: The database I queried is a SBO database with 978 tables and more than 200 fields in each table. In this way, the collected statements are calculated based on an average of 150 fields in each table, and the number of collected statements will reach 146700!

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.