Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding changes can be slow due to a slow query to get latest snapshots #11

Closed
hahn-kev opened this issue Aug 21, 2024 · 1 comment
Closed
Assignees

Comments

@hahn-kev
Copy link
Collaborator

The particular query that's slow is here:

private async Task<SimpleSnapshot[]> GetEntitySnapshots(bool includeDeleted = false)
{
var queryable = _crdtRepository.CurrentSnapshots();
if (!includeDeleted) queryable = queryable.Where(s => !s.EntityIsDeleted);
var snapshots = await queryable.Select(s =>
new SimpleSnapshot(s.Id,
s.TypeName,
s.EntityId,
s.CommitId,
s.IsRoot,
s.Commit.HybridDateTime,
s.Commit.Hash,
s.EntityIsDeleted)).AsNoTracking().ToArrayAsync();
return snapshots;
}

to reproduce import a decent sized fw project into crdts, then try making some changes. That query above should be a big bottleneck in performance.

@hahn-kev hahn-kev self-assigned this Aug 21, 2024
@hahn-kev
Copy link
Collaborator Author

hahn-kev commented Oct 8, 2024

fixed in #12

@hahn-kev hahn-kev closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant