diff --git a/src/RecordManager/Base/Database/PDODatabase.php b/src/RecordManager/Base/Database/PDODatabase.php index 3c16b5e0..b24ca522 100644 --- a/src/RecordManager/Base/Database/PDODatabase.php +++ b/src/RecordManager/Base/Database/PDODatabase.php @@ -1261,7 +1261,7 @@ protected function getIndexHints(string $collection, array $filter, array $optio if (!$this->useIndexHints || !$this->isMySQLCompatible()) { return ''; } - if ('record' === $collection && isset($options['sort']['_id'])) { + if ('record' === $collection && isset($options['sort']['_id']) && isset($filter['source_id'])) { return 'USE INDEX (source_update_needed)'; } return '';