In one field I need to store not a datetime pair, i.e. a standard Oracle date.
01/10/2009 22:10:39
But time only
22:10:39
I think that save disk space (I have 2 million rows) or provide faster processing.
In one field I need to store not a datetime pair, i.e. a standard Oracle date.
01/10/2009 22:10:39
But time only
22:10:39
I think that save disk space (I have 2 million rows) or provide faster processing.
You can extract the time from a date as a string like this:
but there is no time-only data type that will help you save space.
you can use:
example
for time format you can check in here
You would save a few Mb of disk space(which is nothing nowadays) and you would gain next to nothing in performance.
You could use a column of
NUMBER
type for storing the number of seconds since midnight as suggested, just don't forget about the constraints.(You'd probably use
NUMBER(5, 0)
which uses 1-3 bytes depending on the stored value, instead of a constant 7 bytes used by aDATE
column)You could try the INTERVAL DAY TO SECOND data type but it won't save you any disk space ... it is very suitable for this purpose though.
11 bytes though.
Your best bet would probably be storing "seconds since midnight" as a number field.