>OK
>
>Table with datetime field (more than 10,000,000 lines).
>
>I have to rerieve the following ranges by indexs:
>
>Dates
>Time for specific date
>Time from date X to date Y.
>
>Other question is that most of the times (99.9%) I need the time index only the last three month, and the index date only for last two years, do I have to create huge index for all the table?
In our cases we're using just one index on datetime. If we need to get all records for specific date we use
between date() and dttot(date()+1)-1.
If it's not broken, fix it until it is.
My Blog