MySQL - how to speed up SELECT SUM
<p>I have a MySQL table like this:</p>

<pre><code>CREATE TABLE `goods_flow` (
 `cycle_id` int(11) NOT NULL,
 `subject_id` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
 `origin_id` int(11) NOT NULL,
 `flow_value` int(11) NOT NULL,
 PRIMARY KEY (`cycle_id`,`origin_id`,`subject_id`),
 KEY `fk_goods_flow_subjects` (`subject_id`),
 KEY `fk_goods_flow_origins` (`origin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
</code></pre>

<p>and the application often uses this query:</p>

<pre><code>SELECT SUM(flow_value) AS 'amount_of_goods' FROM goods_flow WHERE subject_id = 'xyz';
</code></pre>

<p>which takes a long time.</p>

<p>How could I speed up the query execution?
Thank You</p>