Skip to content

Commit 2d4cb5e

Browse files
starzeGrotax
authored andcommitted
Improve sql query performance by removing unused payload
Signed-off-by: Daniel Starzmann <[email protected]>
1 parent 51d026a commit 2d4cb5e

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is mostly based on [Keep a Changelog](https://keepachangelog.com/en/1
88
### Changed
99

1010
### Fixed
11+
- Improve performance of item updates (#1322)
1112

1213
# Releases
1314
## [21.2.0-beta2] - 2023-04-05

lib/Db/ItemMapperV2.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function newest(string $userId): Entity
314314
{
315315
$builder = $this->db->getQueryBuilder();
316316

317-
$builder->select('items.*')
317+
$builder->select('items.id')
318318
->from($this->tableName, 'items')
319319
->innerJoin('items', FeedMapperV2::TABLE_NAME, 'feeds', 'items.feed_id = feeds.id')
320320
->where('feeds.user_id = :userId')

tests/Unit/Db/ItemMapperTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ public function testNewest()
419419

420420
$this->builder->expects($this->once())
421421
->method('select')
422-
->with('items.*')
422+
->with('items.id')
423423
->will($this->returnSelf());
424424

425425
$this->builder->expects($this->once())

0 commit comments

Comments
 (0)