Skip to content

Index improvements on oc_preferences #30421

@juliusknorr

Description

@juliusknorr

IConfig methods may issue queries which are causing a full table scan on oc_preferences with using the existing primary key as an index as it is only partially filtered for in the where clause, as the order seems to be relevant (userid,appid,configkey)

public function getUsersForUserValue($appName, $key, $value) {
// TODO - FIXME
$this->fixDIInit();
$sql = 'SELECT `userid` FROM `*PREFIX*preferences` ' .
'WHERE `appid` = ? AND `configkey` = ? ';

public function deleteAppFromAllUsers($appName) {
// TODO - FIXME
$this->fixDIInit();
$sql = 'DELETE FROM `*PREFIX*preferences` '.
'WHERE `appid` = ?';

CREATE INDEX prefix_configvalue_index on oc_preferences (configvalue(80));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions