Issue #2950869: Entity queries querying the latest revision very slow with lots of revisions
1 unresolved thread
Issue #2950869 by amateescu, alexpott, Fabianx, abhishek-anand, ravi.shankar, adam.weingarten, Timmy_Cos, Rashmisoni, bryanmanalo, pooja saraah, pratik, corneboele, matsbla, Wim Leers, mheip, mariancalinro, effulgentsia, Krzysztof Domański, lucassc: Entity queries querying the latest revision very slow with lots of revisions
Closes #2950869
Merge request reports
Activity
added 1 commit
- 50e98816 - Update test to do a change that keeps the entity in the result and we can...
482 482 483 483 if (!isset($this->latestRevisionIds[$entity_id][LanguageInterface::LANGCODE_DEFAULT])) { 484 484 $result = $this->getQuery() 485 ->latestRevision() 485 ->allRevisions() 486 486 ->condition($this->entityType->getKey('id'), $entity_id) 487 ->range(0, 1) 488 ->sort($this->entityType->getKey('revision'), 'DESC') - Comment on lines -485 to +488
Not sure this change is not a BC, as per:
public function latestRevision() { $this->allRevisions = TRUE; $this->latestRevision = TRUE; return $this; } public function allRevisions() { $this->allRevisions = TRUE; $this->latestRevision = FALSE; return $this; }
So we should have still
$this->latestRevision = TRUE
.
My proposal is to add just a->range(0, 1)
to it, i.e.:Edited by Dmitry Korkhau
Please register or sign in to reply