Suppose I have a table
STOCKCODE, DATETIME, PRICE
I want to perform a basic query such as finding the maximum price between 12.00 PM and 3.00 PM on a given date for a given stock. Currently I index by:
STOCKCODE, DATETIME, PRICE
DATETIME is granular down to the millisecond level in other words there is basically no duplicate data. For the type of query that I wish to perform is there a better way to index? Or more generally is there a better schema that I could use?