/**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // count threads
     $sql = "SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twbb" . WBB_N . "_thread";
     $row = WCF::getDB()->getFirstRow($sql);
     $count = $row['count'];
     // get thread ids
     $threadIDs = '';
     $sql = "SELECT\t\tthreadID, topic\n\t\t\tFROM\t\twbb" . WBB_N . "_thread\n\t\t\tORDER BY\tthreadID";
     $result = WCF::getDB()->sendQuery($sql, $this->limit, $this->limit * $this->loop);
     if (!WCF::getDB()->countRows($result)) {
         $this->calcProgress();
         $this->finish();
     }
     while ($row = WCF::getDB()->fetchArray($result)) {
         // delete old entries
         $sql = "DELETE FROM\twbb" . WBB_N . "_thread_similar\n\t\t\t\tWHERE\t\tthreadID = " . $row['threadID'];
         WCF::getDB()->sendQuery($sql);
         // update entries
         ThreadEditor::updateSimilarThreads($row['threadID'], $row['topic']);
     }
     $this->executed();
     $this->calcProgress($this->limit * $this->loop, $count);
     $this->nextLoop();
 }