Improve db4o linq query
I got a problem with this linq query:
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 );
As you can see, each PersistedCommit
contains Collection<int>
, called FileIDs
, which connects it to its PersistedFileInfo
s. I want to select all previous commits of a specific fileInfo (which is identified by its path).
I have about 800 PersistedFileInfo
and 10 PersistedCommit
s. The request takes about 1.5 seconds - it's too long. The object's contractor Commit
only stores the two given arguments, so there is no timeloss here.
My question is:
Could this query be rewritten to perform better - or is it a db4o issue (use SODA query instead)?
source to share