 <p>I suggest you try this:</p> <p>Add this permutation of your compound index.</p> <pre><code> (campaign_id,domain,log_time,log_type,subscriber_id) </code></pre> <p>Change your query to remove the <code>WHERE log_type IN()</code> criterion, thus allowing the aggregate function to use all the records it finds in the range scan on <code>log_time</code>. Including <code>subscriber_id</code> in the index should allow the whole query to be satisfied directly from the index. That is, this is a <em>covering index</em>.</p> <p>Finally, you can filter on your <code>log_type</code> values by wrapping the whole query in </p> <pre><code> SELECT * FROM (/*the whole query*/) x WHERE log_type IN ('EMAIL_SENT', 'EMAIL_CLICKED', 'EMAIL_OPENED', 'UNSUBSCRIBED') ORDER BY log_type </code></pre> <p>This should give you better, and more predictable, performance.</p> <p>(Unless the log_types you want are a tiny subset of the records, in which case please ignore this suggestion.)</p>