MySQL Forums
Forum List  »  Newbie

help with long query
Posted by: George Develekos
Date: July 18, 2005 12:19AM

I have a long query that involves a single table that has four attributes, let's call them A,B,C and T, where A/B/C are strings and T is Timestamp.

The query goes like this:

select count(*) from mytable where T between T1 and T2 and B=b and C=c and A in (select A from mytable where B=b2 and C=c2)

This query, on a InnoDB query with ~1.7million rows, on a Pentium 4 with 1G RAM, took 70min to run.

Would I benefit from a MyIsam table type? Any other suggestions?? I attempted to run this a INTERSECT operation but apparently such an operation is not supported by v4.1.

I decided to port this table from DB2 to MySQL hoping for better performance, but so far this attempt has bombed...

Thanks for any help.

George

Options: ReplyQuote


Subject
Written By
Posted
help with long query
July 18, 2005 12:19AM


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.