MySQL Forums
Forum List  »  Optimizer & Parser

querying time is too high
Posted by: trinath somanchi
Date: June 27, 2006 07:31AM

Hi All,

I need help to query a table which is having 16.5 million records.
I need to group the data by two columns.

When I try to group by two columns its taking too much of time. Even i tried after indexing the table.

query is:

select username,id,average(abc) as avg1,average(exp) as avg2 from usr_tbl where date<=<some date> and date>=<some date> group by username,id having avg1 > <value> and avg2 > <value>;

In this table primary key is a combination of (date,username,id).

Please help me in this regard.

Thanks in advance,

--
Trinath Somanchi.

--
Trinath Somanchi,
( http://www.myospages.com ).



Edited 1 time(s). Last edit at 06/27/2006 09:58PM by trinath somanchi.

Options: ReplyQuote


Subject
Views
Written By
Posted
querying time is too high
2877
June 27, 2006 07:31AM
1953
June 28, 2006 10:00AM
1909
June 29, 2006 12:48AM
1912
June 29, 2006 08:52AM


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.