I've added a code responsible for adding this missing index. I've verified that fix add the index and that index is used by MySQL during execution of this query.
Below is result of execution of following explain in JSON.
explain select jid, jid_id from tig_ma_jids where jid = 'admin@localhost';
I've verified SQL schemas for version 2.0.0, but there is no need for an index on jid field as for MySQL jid_id is looked up using newly introduced jid_sha1 field which already has an index.
wojciech.kapcia@tigase.net commented 7 years ago
%andrzej.wojcik shouldn't this index be added to other databases as well (MS SQL Server, Postgresql)?
Andrzej Wójcik (Tigase) commented 7 years ago
Other DB schemas already contain this index. Only MySQL schema was missing this index.
It looks like there is a missing index on
tig_ma_jids
conflicted with multiplesselect
calls: