MySQL Forums
Forum List  »  Performance

Help with Covering Index
Posted by: Erin ONeill
Date: February 05, 2008 05:20PM

Data warehousing is not my specialty I need a covering index on a stats query and I'm just not getting it.

I have 3 main queries.

Here's one
explain SELECT DISTINCT l.show_id,l.episode_id,l.hitday,SUM(traffic)/1048576 AS traffic, COUNT(longip) AS hit_count,COUNT(distinct longip) AS unique_hit_count
FROM o_hits AS l
WHERE l.status BETWEEN 100 AND 199
GROUP BY l.show_id,l.episode_id,l.hitday


I've tired:
index on status
index on status,show_id,episode_id, hitday

Explain will say something like this:
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: l
type: ALL
possible_keys: cover
key: NULL
key_len: NULL
ref: NULL
rows: 22329227
Extra: Using where; Using filesort

I'm just missing it. I know I'm staring at the answer but can't seem to see it.

Thoughts? suggestions?

Thanks
erin

Options: ReplyQuote


Subject
Views
Written By
Posted
Help with Covering Index
4834
February 05, 2008 05:20PM
1798
February 13, 2008 12:50AM
1805
February 19, 2008 03:59PM
1778
May 30, 2008 11:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.