From 504e26574cd98594d1b7f15efbe7bc77ad3b37c4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 5 Jun 2020 14:16:29 +0200 Subject: Make sure pinging session ids only uses indexes Since sessions are unique globally (apart from '0' which is filtered out before) we can update the ping only based on the index instead of index + additional where check Signed-off-by: Joas Schilling --- lib/Room.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Room.php b/lib/Room.php index d3e9795af..9924241af 100644 --- a/lib/Room.php +++ b/lib/Room.php @@ -1319,8 +1319,7 @@ class Room { $query = $this->db->getQueryBuilder(); $query->update('talk_participants') ->set('last_ping', $query->createNamedParameter($timestamp, IQueryBuilder::PARAM_INT)) - ->where($query->expr()->eq('room_id', $query->createNamedParameter($this->getId(), IQueryBuilder::PARAM_INT))) - ->andWhere($query->expr()->in('session_id', $query->createNamedParameter($sessionIds, IQueryBuilder::PARAM_STR_ARRAY))); + ->where($query->expr()->in('session_id', $query->createNamedParameter($sessionIds, IQueryBuilder::PARAM_STR_ARRAY))); $query->execute(); } -- cgit v1.2.3