Re: query performance slow
Bob Pisani wrote:
> PRIMARY KEY(ORDER_TIME, ORDER_ID)
Bob Pisani wrote:
> -- Indexes -- > PRIMARY KEY(ORDER_ID, ORDER_TIME) - UniqueHashIndex > PRIMARY(ORDER_TIME, ORDER_ID) - OrderedIndex
So the hash index is going to work fast. But its the ordered index that
would be used for a range query. I would try reversing this key to be:
PRIMARY KEY(ORDER_ID, ORDER_TIME)
and see if it gets better. Hopefully that will make the OrderedIndex in
the proper order. Even in MyISAM and InnoDB you would want that order
anyway for their BTree indexes. Basically, values that will queried
based on range need to go as far to the right in the index as possible.
--
Brian Moon
Senior Developer
------------------------------
http://dealnews.com/
It's good to be cheap =)
--
MySQL Cluster Mailing List
For list archives:
http://lists.mysql.com/cluster
To unsubscribe:
http://lists.mysql.com/cluster?unsub=lists@pantek.com
Received on Thu Jul 26 10:44:31 2007
This archive was generated by hypermail 2.1.8
: Thu Aug 09 2007 - 19:30:34 EDT
|