【问题标题】:Improve db4o linq query改进 db4o linq 查询
【发布时间】:2009-09-01 17:07:02
【问题描述】:

我遇到了这个 linq 查询的问题:

from PersistedFileInfo fi in m_Database
from PersistedCommit commit in m_Database
where commit.FileIDs.Contains( fi.ID )
where fi.Path == <given path>
select new Commit( m_Storage, commit );

如您所见,每个PersistedCommit 都包含一个名为FileIDsCollection&lt;int&gt;,它将它连接到它的PersistedFileInfos。我想选择特定 fileInfo(由其路径标识)的所有先前提交。

我有大约 800 个PersistedFileInfos 和 10 个PersistedCommits。查询大约需要 1.5 秒 - 我认为这太长了。 Commit-object 的构造函数只保存两个给定的参数 - 所以这里没有时间损失。

我的问题:
是否可以重写此查询以更好地执行 - 还是 db4o 问题(改用 SODA 查询)?

【问题讨论】:

    标签: linq performance db4o


    【解决方案1】:

    请检查您的 NQ 是否确实优化 (see here)。如果没有,那么您最好自己将其翻译成 SODA 查询。

    戈兰

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-18
      • 1970-01-01
      • 1970-01-01
      • 2021-01-30
      • 2021-12-13
      相关资源
      最近更新 更多