summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevin.dutra2018-02-18 21:50:37 (GMT)
committerThomas Seidl2018-02-18 21:50:37 (GMT)
commitc0bd5b5e42c2e638492142b0be58451d28dfab3b (patch)
treee2c4b17514d95445065c5d7ea4b23e9140fc1e0e
parent1a72199abeb4a2a4536b1571df9323dbbb5d1846 (diff)
Issue #2943705 by kevin.dutra, drunken monkey, borisson_: Fixed performance problems with LIFO tracker.
-rw-r--r--CHANGELOG.txt2
-rw-r--r--src/Plugin/search_api/tracker/Basic.php7
2 files changed, 6 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 975aa04..c5cb3f4 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,7 @@
Search API 1.x, dev (xxxx-xx-xx):
---------------------------------
+- #2943705 by kevin.dutra, drunken monkey, borisson_: Fixed performance
+ problems with LIFO tracker.
- #2942846 by idebr, drunken monkey, borisson_: Added empty/not empty operators
to Views fulltext field filters.
- #2940255 by drunken monkey: Updated the DB autocomplete implementation to the
diff --git a/src/Plugin/search_api/tracker/Basic.php b/src/Plugin/search_api/tracker/Basic.php
index dcf5feb..f122fbf 100644
--- a/src/Plugin/search_api/tracker/Basic.php
+++ b/src/Plugin/search_api/tracker/Basic.php
@@ -196,10 +196,11 @@ class Basic extends TrackerPluginBase implements PluginFormInterface {
$select->condition('datasource', $datasource_id);
}
$select->condition('sai.status', $this::STATUS_NOT_INDEXED, '=');
- $lifo = $this->configuration['indexing_order'] === 'lifo';
- $select->orderBy('sai.changed', $lifo ? 'DESC' : 'ASC');
+ // Use the same direction for both sorts to avoid performance problems.
+ $order = $this->configuration['indexing_order'] === 'lifo' ? 'DESC' : 'ASC';
+ $select->orderBy('sai.changed', $order);
// Add a secondary sort on item ID to make the order completely predictable.
- $select->orderBy('sai.item_id', 'ASC');
+ $select->orderBy('sai.item_id', $order);
return $select;
}