Made scanner abort faster when it has to clean a lot of stuff

This commit is contained in:
emeric
2023-11-14 13:47:08 +01:00
parent 9cfc47fc82
commit b4e515f825
7 changed files with 107 additions and 99 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ namespace Database
return Utils::execQuery<Cluster::pointer>(query, params.range);
}
RangeResults<ClusterId> Cluster::findOrphans(Session& session, std::optional<Range> range)
RangeResults<ClusterId> Cluster::findOrphanIds(Session& session, std::optional<Range> range)
{
session.checkSharedLocked();
auto query{ session.getDboSession().query<ClusterId>("SELECT DISTINCT c.id FROM cluster c WHERE NOT EXISTS(SELECT 1 FROM track_cluster t_c WHERE t_c.cluster_id = c.id)") };