summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Starzmann <daniel@starze.de>2023-04-12 16:18:05 +0200
committerBenjamin Brahmer <info@b-brahmer.de>2023-04-16 11:13:30 +0200
commit2d4cb5ed1c0fba33be5dcfc837a4af41e3d948c4 (patch)
tree7377d7925dd051d7282fce5eac67b6b68d44ff46
parent51d026a46aaced44385c0244747f70456b113b56 (diff)
Improve sql query performance by removing unused payload
Signed-off-by: Daniel Starzmann <daniel@starze.de>
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/Db/ItemMapperV2.php2
-rw-r--r--tests/Unit/Db/ItemMapperTest.php2
3 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f2853074f..6323e7d5a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ The format is mostly based on [Keep a Changelog](https://keepachangelog.com/en/1
### Changed
### Fixed
+- Improve performance of item updates (#1322)
# Releases
## [21.2.0-beta2] - 2023-04-05
diff --git a/lib/Db/ItemMapperV2.php b/lib/Db/ItemMapperV2.php
index d8b36723d..972295ee3 100644
--- a/lib/Db/ItemMapperV2.php
+++ b/lib/Db/ItemMapperV2.php
@@ -314,7 +314,7 @@ class ItemMapperV2 extends NewsMapperV2
{
$builder = $this->db->getQueryBuilder();
- $builder->select('items.*')
+ $builder->select('items.id')
->from($this->tableName, 'items')
->innerJoin('items', FeedMapperV2::TABLE_NAME, 'feeds', 'items.feed_id = feeds.id')
->where('feeds.user_id = :userId')
diff --git a/tests/Unit/Db/ItemMapperTest.php b/tests/Unit/Db/ItemMapperTest.php
index 80421bc0a..397f3be2c 100644
--- a/tests/Unit/Db/ItemMapperTest.php
+++ b/tests/Unit/Db/ItemMapperTest.php
@@ -419,7 +419,7 @@ class ItemMapperTest extends MapperTestUtility
$this->builder->expects($this->once())
->method('select')
- ->with('items.*')
+ ->with('items.id')
->will($this->returnSelf());
$this->builder->expects($this->once())