we are running a "heavy" CMDB with approx 4000 entries and I'm experiencing poor performance there.
MySQLLogSlow queries is enabled and I have a lot of messages there like
Code: Select all
SELECT DISTINCT(xml_key) FROM xml_storage WHERE xml_type = 'ITSM::ConfigItem::32';
SELECT DISTINCT(xml_key) FROM xml_storage WHERE xml_type = 'ITSM::ConfigItem::33' AND ( (xml_content_key LIKE '[1]{\'Version\'}[1]{\'OCSID\'}[1]{\'Content\'}' AND xml_content_value LIKE '<something>' ) );
Code: Select all
mysql> explain SELECT DISTINCT(xml_key) FROM xml_storage WHERE xml_type = 'ITSM::ConfigItem::32';
+----+-------------+-------------+------+------------------+------------------+---------+-------+-------+------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+------------------+------------------+---------+-------+-------+------------------------------+
| 1 | SIMPLE | xml_storage | ref | xml_storage_type | xml_storage_type | 602 | const | 89676 | Using where; Using temporary |
+----+-------------+-------------+------+------------------+------------------+---------+-------+-------+------------------------------+
1 row in set (0.00 sec)
What to do?