Skip to content

Commit

Permalink
Disable eager-loading of joins
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Nov 4, 2024
1 parent 166fd3b commit b3e7dbe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/helpers/RefreshCacheHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static function getElementCacheIds(string $elementType, RefreshDataModel
return ElementCacheRecord::find()
->select(ElementCacheRecord::tableName() . '.cacheId')
->where($condition)
->joinWith('elementFieldCaches')
->joinWith('elementFieldCaches', false)
->groupBy(ElementCacheRecord::tableName() . '.cacheId')
->column();
}
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/SiteUriHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static function getSiteUrisForSite(int $siteId): array
Element::tableName() . '.enabled' => true,
])
->andWhere(['not', ['uri' => null]])
->joinWith('element')
->joinWith('element', false)
->orderBy(['uri' => SORT_ASC])
->column();

Expand Down Expand Up @@ -460,7 +460,7 @@ public static function getSiteUrisFromTags(array $tags): array
/** @var array $siteUris */
$siteUris = CacheTagRecord::find()
->select(['siteId', 'uri'])
->joinWith('cache')
->joinWith('cache', false)
->where(['tag' => $tags])
->asArray()
->all();
Expand Down
2 changes: 1 addition & 1 deletion src/services/CacheTagsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getSiteUriTags(SiteUriModel $siteUri): array
{
return CacheTagRecord::find()
->select(['tag'])
->joinWith('cache')
->joinWith('cache', false)
->where($siteUri->toArray())
->groupBy(['tag'])
->column();
Expand Down
2 changes: 1 addition & 1 deletion src/services/FlushCacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function runGarbageCollection(bool $isAfterFullClear = false): void
// Get and delete element query records without an associated element query cache
$elementQueryRecordIds = ElementQueryRecord::find()
->select(['id'])
->joinWith('elementQueryCaches')
->joinWith('elementQueryCaches', false)
->where(['cacheId' => null])
->column();

Expand Down

0 comments on commit b3e7dbe

Please sign in to comment.