SQLite's Business

Source: Internet
Author: User
Tags sqlite

Long time no database, knowledge has forgotten, before using SQLite line insert data, found that this performance is too pit, 10w data, insertion took about 100 minutes.

Later found that there is a transaction such a thing, can greatly reduce the operation of the IO, the test inserted 40w data, about 5 minutes or so, than the previous insert but 666

WCHAR Szbuffer[max_path] = {0};  WCHAR szbuffer2[1024] = {0};for (int i = 0; i < 500000; i+=100) {wstring Strsql;strsql + = L "begin;\n"; for (int index = 0; Index <= 100;++index) {swprintf_s (Szbuffer, MAX_PATH, L "xxxxxxxxx.yyyyy.%d", I+index); swprintf_s (SzBuffer2, 1024, Insert_fileinfo_table, Szbuffer, True, 0.0f, true), strSQL + = Szbuffer2;strsql + = L "; \ n";} strSQL + = L "commit;"; FileInfo. Execute (Strsql.c_str ());}

SQLite's Business

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.