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.
------------------------------
http://dealnews.com/
It's good to be cheap =)