我如何可以加快使用SQLite的CSHARP SQL查询? [英] How can I speed up SQL queries using CSharp SQLite?

查看:92
本文介绍了我如何可以加快使用SQLite的CSHARP SQL查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:结果
我有一个SQLite3的数据库,我使用的 CSHARP的SQLite 来查询数据。我的问题是有任何疑问JOIN或ORDER BY调用是很慢(0.1秒使用 CSHARP-SQLite的 VS 0.003秒使用原稿的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).

最新的基准了解CSHARP的SQLite表明它至多2倍速度较慢,这将是很好,但我发现时间是30倍的速度较慢。

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.

现在,我已经收录在我的数据库中的所有必要的字段,并有相应的主键和外键。 。另外,原来的SQLite运行这些查询细

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.

问:结果
我必须使用的托管代码端口SQLite的,所以有什么我失踪这里还是一个电话,我需要做出 CSHARP的SQLite ? ?是否有其他SQLite库口外面的某个地方

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?

推荐答案

这个确切的问题被问了的Csharp-sqlite论坛和成功的解决办法是删除在编译时SQLITE_ENABLE_OVERSIZE_CELL_CHECK标志。这是导致不必要的,但大量的计算调试标志。

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.

这篇关于我如何可以加快使用SQLite的CSHARP SQL查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆