Skip to content

Commit 636f778

Browse files
committed
Improve element query performance
Resolves #9806
1 parent 5670d37 commit 636f778

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
### Changed
1010
- Improved the performance of applying drafts. ([#9802](https://github.com/craftcms/cms/issues/9802))
11+
- Improved the performance of element queries. ([#9806](https://github.com/craftcms/cms/discussions/9806))
1112
- Live Preview is once again supported by entries when the `autosaveDrafts` config setting is disabled.
1213
- Checkboxes, Dropdown, Multi-select, and Radio Buttons fields now include the selected options’ labels in their search keywords. ([#9799](https://github.com/craftcms/cms/issues/9799))
1314
- It’s now possible for field types to disable delta name registration for nested custom fields by calling `Craft::$app->view->setIsDeltaRegistrationActive(false);` before rendering them.

src/elements/db/ElementQuery.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,7 @@ public function prepare($builder)
14371437
->from(['elements' => Table::ELEMENTS])
14381438
->innerJoin(['elements_sites' => Table::ELEMENTS_SITES], '[[elements_sites.elementId]] = [[elements.id]]')
14391439
->andWhere($this->where)
1440+
->andWhere(['elements.type' => $this->elementType])
14401441
->offset($this->offset)
14411442
->limit($this->limit)
14421443
->addParams($this->params);

0 commit comments

Comments
 (0)