The order of the columns in the composite index definition is very
important for your case.
If you want the optimal performance, you need to put the timestamp
column last in the index definition because it is used with a
range. The server cannot use the column of an index after one with
a range qualifier.
For example, in your case, if your composite index is define like
these example with a = check on fkY and fkZ and a range on dateX:
- (dateX, fkY, fkZ), only the date columsn is used like an index
(dateX)
- (fkY, dateX, fkZ), only the fkY and date columsn is used like an
index (fkY, dateX)