ferrosti wrote:Have a look at your 'Rows examined' value!
Is there an index missing on 'link_relation.source_key' ?
Please update your signature about system information!
Its orts 2.4.7.
Code: Select all
CREATE TABLE `link_relation` (
`source_object_id` smallint(6) NOT NULL,
`source_key` varchar(50) NOT NULL,
`target_object_id` smallint(6) NOT NULL,
`target_key` varchar(50) NOT NULL,
`type_id` smallint(6) NOT NULL,
`state_id` smallint(6) NOT NULL,
`create_time` datetime NOT NULL,
`create_by` int(11) NOT NULL,
UNIQUE KEY `link_relation_view` (`source_object_id`,`source_key`,`target_object_id`,`target_key`,`type_id`),
KEY `FK_link_relation_target_object_id_id` (`target_object_id`),
KEY `FK_link_relation_state_id_id` (`state_id`),
KEY `FK_link_relation_type_id_id` (`type_id`),
KEY `FK_link_relation_create_by_id` (`create_by`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
ticket | MyISAM | 2.83 Mb | 13774 rows
link_relation | MyISAM | 0.05 Mb | 1334 rows
13774*1334=18374516.
How can I change query or table indexes to avoid this?