简体   繁体   中英

How to use SQLite PRAGMA threads = X ; into C++ code

I am working on a project in C/C++ where i need to speed up some SQLite queries.

Which in my computer takes about 4.5 seconds and returns 214.000 rows.

One idea i had is to use:

PRAGMA threads = 2;

before the query.

I tried it at the sqlitebrowser and the query took 2 seconds which is a nice improvement in my case.

The question is: how i can do the same inside my C++ code? I concatenated the query after the PRAGMA but i didn't got any improvement.

I also tried sqlite3_limit(db,SQLITE_LIMIT_WORKER_THREADS,4); with no luck. Any suggestions would be much appreciated.

PRAGMA语句是一个与其他任何SQL语句一样的语句,只需单独执行即可。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM