Mike Webb
Mike Webb

Reputation: 9003

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?

Upvotes: 2

Views: 1685

Answers (1)

Stewart
Stewart

Reputation: 4260

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.

Upvotes: 5

Related Questions