nextcloud / spreed

πŸ—¨οΈ Nextcloud Talk – chat, video & audio calls for Nextcloud
https://nextcloud.com/talk
GNU Affero General Public License v3.0
1.59k stars 422 forks source link

Missing index for talk_invitations database lookup #12553

Open ChristophWurst opened 2 weeks ago

ChristophWurst commented 2 weeks ago

How to use GitHub


Steps to reproduce

  1. ???

Expected behaviour

Efficient database operations

Actual behaviour

SELECT
  COUNT (*)
FROM
  `oc_talk_invitations`
WHERE
  (`user_id` = ?)
  AND (`state` = ?)

not using an index.

Looking at https://github.com/nextcloud/spreed/blob/38bfcad79113a110084789db21e93cbaed668627/lib/Model/InvitationMapper.php#L71-L100 it seems like an index on (user_id, state) would be a good candidate.

Talk app

Talk app version: (see apps administration page: /index.php/settings/apps)

Custom Signaling server configured: yes/no and version (see Talk administration settings: /index.php/settings/admin/talk#signaling_server)

Custom TURN server configured: yes/no (see Talk administration settings: /index.php/settings/admin/talk#turn_server)

Custom STUN server configured: yes/no (see Talk administration settings: /index.php/settings/admin/talk#stun_server)

Browser

Microphone available: yes/no

Camera available: yes/no

Operating system: Windows/Ubuntu/Mac/...

Browser name: Firefox/Chrome/Safari/...

Browser version: 124/125/...

Browser log

``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```

Server configuration

Operating system: Ubuntu/RedHat/...

Web server: Apache/Nginx

Database: MySQL/Maria/SQLite/PostgreSQL

PHP version: 8.1/8.2/8.3

Nextcloud Version: (see administration page)

List of activated apps:

``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your server installation folder ```

Nextcloud configuration:

``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder ```

Server log (data/nextcloud.log)

``` Insert your server log here ```

Query ID 805953543f46cc758e6b0239a23b8bfd

nickvergessen commented 2 weeks ago

yeah it's more important now that we don't delete invites when they got accepted. This was not the case in the beginning