I have a collection of 50 million documents. Every query against this collection will contain two parameters: data_type and datetime. I am not doing any sorting on the results of the queries.
data_type is a somewhat small list of discrete values (about 100 values, and each of the 50 million documents as one data type).
datetime is an integer in the format YYYYMMDDHH (i.e. 2011042606).
A common query is to find all the documents for 4 data types within the last 45 minutes.
I want a compound index on these two values. Is there any difference between a compound index of {data_type:1, datetime:1} and {datetime:1, data_type:1} in this case? Remember, every query against this collection has both of those parameters, and I will not be sorting the results.
Thanks,