简体   繁体   中英

How can I speed up SQL queries using CSharp SQLite?

Background:
I have a SQLite3 database and I am using CSharp SQLite to query data. My problem is that any queries with JOIN or ORDER BY calls are really slow (0.1 sec using CSharp-SQLite vs 0.003 sec using orig. SQLite ).

The latest benchmarks for CSharp SQLite indicate that it is at most 2x slower, which would be fine, but I'm getting times that are 30x slower.

Now, I have indexed all the necessary fields in my database and have the appropriate Primary and Foreign keys. Plus, the original SQLite runs these queries fine.

Question:
I have to use a managed code port of SQLite, so is there something I'm missing here or a call I need to make to CSharp SQLite ? Is there an alternative SQLite library port out there somewhere?

This precise question was asked in the Csharp-sqlite forums and the successful solution was to remove the SQLITE_ENABLE_OVERSIZE_CELL_CHECK flag at compile time. This is a DEBUG flag that results in unneeded but intensive calculations.

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