mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 17:42:29 -04:00
Rewrite DeleteUnused() queries using new indices
This commit is contained in:
parent
5c8315e6ff
commit
f0bfa7a43b
3 changed files with 13 additions and 13 deletions
|
@ -104,10 +104,10 @@ class Collection{
|
|||
*/
|
||||
public static function DeleteUnused(): void{
|
||||
Db::Query('
|
||||
DELETE
|
||||
from Collections
|
||||
where CollectionId not in
|
||||
(select distinct CollectionId from CollectionEbooks)
|
||||
DELETE c
|
||||
from Collections c
|
||||
left join CollectionEbooks ce using (CollectionId)
|
||||
where ce.CollectionId is null
|
||||
');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue