delete t from btc_bt_torrents t where t.tid not in (select e.tid from btc_bt_torrents_ext e)
delete e from btc_bt_torrents_ext e where e.tid not in (select t.tid from btc_bt_torrents t)
delete tk from btc_bt_tracker tk where tk.hash not in (select t.hash from btc_bt_torrents t) |