The first query being this?
SELECT ce1.Event_Id, MAX(ce2.Event_Id) FROM
corax_event ce1, corax_event ce2
WHERE ce1.Event_Id > ce2.Event_Id
AND ce1.Cap_Chng_Market_Lvl_Id = ce2.Cap_Chng_Market_Lvl_Id
GROUP BY ce1.Event_Id
If so, you would do well to have an index on corax_event (Event_Id, Cap_Chng_Market_Lvl_Id);
This should reduce the PRIMARY select to a range access type using a (range, eq_ref) strategy. Also, you'll get a covering index, which should speed up the query a bit.
Jay Pipes
Community Relations Manager, North America, MySQL Inc.
Got Cluster?
http://www.mysql.com/cluster
Personal:
http://jpipes.com
Edited 1 time(s). Last edit at 12/16/2005 11:47AM by Jay Pipes.