Use a more efficient SQL when finding Orphaned Frames
parent
34111251d9
commit
7e7e353a8c
|
@ -537,7 +537,7 @@ MAIN: while( $loop ) {
|
||||||
$cleaned = 0;
|
$cleaned = 0;
|
||||||
Debug("Checking for Orphaned Frames");
|
Debug("Checking for Orphaned Frames");
|
||||||
my $selectOrphanedFramesSql = 'SELECT DISTINCT EventId FROM Frames
|
my $selectOrphanedFramesSql = 'SELECT DISTINCT EventId FROM Frames
|
||||||
WHERE EventId NOT IN (SELECT Id FROM Events)';
|
WHERE (SELECT COUNT(*) FROM Events WHERE Events.Id=EventId)=0';
|
||||||
my $selectOrphanedFramesSth = $dbh->prepare_cached( $selectOrphanedFramesSql )
|
my $selectOrphanedFramesSth = $dbh->prepare_cached( $selectOrphanedFramesSql )
|
||||||
or Fatal( "Can't prepare '$selectOrphanedFramesSql': ".$dbh->errstr() );
|
or Fatal( "Can't prepare '$selectOrphanedFramesSql': ".$dbh->errstr() );
|
||||||
$res = $selectOrphanedFramesSth->execute()
|
$res = $selectOrphanedFramesSth->execute()
|
||||||
|
|
Loading…
Reference in New Issue