A free, self-hostable news aggregator…
SQL: MySQL speed optimisation
Alexandre Alapetite6c83264f8322
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.phpindex f184ab1fa..301a2ec49 100644--- a/app/Models/EntryDAO.php+++ b/app/Models/EntryDAO.php@@ -352,6 +352,9 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {default:throw new FreshRSS_EntriesGetter_Exception('Bad order in Entry->listByType: [' . $order . ']!');}+ if ($firstId === '' && parent::$sharedDbType === 'mysql') {+ $firstId = '9000000000' . '000000'; //MySQL optimization. Tested on MySQL 5.5 with 150k articles+ }if ($firstId !== '') {$where .= 'AND e1.id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' ';}