Improve the performance of the export of conversation participants
authorAlexander Ebert <ebert@woltlab.com>
Tue, 15 Aug 2023 12:18:23 +0000 (14:18 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 15 Aug 2023 12:18:23 +0000 (14:18 +0200)
files/lib/system/exporter/VB3or4xExporter.class.php

index 861c8dbdb130e09965a91535606aa2a21ca36efe..dad8b7ac2a6fd31140909939e7eb550b405d3a00 100644 (file)
@@ -1175,9 +1175,10 @@ class VB3or4xExporter extends AbstractExporter
                 ON          pm.userid = user.userid
                 INNER JOIN  " . $this->databasePrefix . "pmtext pmtext
                 ON          pmtext.pmtextid = pm.pmtextid
+                WHERE       pm.pmid BETWEEN ? AND ?
                 ORDER BY    pm.pmid";
-        $statement = $this->database->prepareStatement($sql, $limit, $offset);
-        $statement->execute();
+        $statement = $this->database->prepareStatement($sql);
+        $statement->execute([$offset + 1, $offset + $limit]);
         while ($row = $statement->fetchArray()) {
             $participants = \explode(',', $row['participants']);
             $participants[] = $row['fromuserid'];