Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> dates in index
I have a table with a date, where I store data with both date & time
info (1/1/99 3:30pm). I have in the range of 50-150K records per day.
I would like to be able to select records for just a day or range of
days without doing a full-table search.
What is the best way to index this? Should I make a separate column with just the date? I would like to keep a column with both the date & time together for queries that look at date/time in a sequence. Total disk space isn't a big issue at this point.
So far I can do 'select * ..... where trunc(date_column) = '1/1/99'; I am not sure if this is using the index or not, I don't have enough days data in there, and it is a fast machine.
Also, if I was using MS Access as a front end on this, I can't do a query with group by date, because each time makes a different value. Access doesn't have 'trunc', and using VB's format(dt,"mm/dd/yy") takes forever because it reads a row and formats it on the client, I think.
Thanks in advance for any help on this. Received on Wed Jan 26 2000 - 18:49:18 CST