Date time with millisecond

Hi All,

I have a question regarding the index and search of the date time field
which store date with millisecond. Is there any known problem or issue if I
store the millisecond? I am using "yyyyMMdd’T’HHmmss.SSSZ" date format to
store the datetime value. As per my understanding, if we store the date
value with millisecond granularity, then the index size will be bigger than
if we don't store the millisecond. As there will be less number of unique
values. Searching is also get affected if we store millisecond data as
there are more number of docs to search.

Has someone face any issue with the date time with millisecond value. I
want to use the millisecond for the sorting of the results i.e. if there
are 100 docs within a second then it should be sort by the millisecond
value.

Please help me and provide your inputs.

Thanks
Ashu

--

Hi Ashu,

I've used millisecond timestamps and I didn't have any issues. Of course,
the index size would be slightly larger, but if you need millisecond
granularity, I think you should go for it.

Sure, sorting on date will be slower because there will be more unique
values to sort. But then, that's what you want in the first place, so it's
not like you're wasting resources.

Best regards,
Radu

http://sematext.com/ -- Elasticsearch -- Solr -- Lucene

On Mon, Dec 17, 2012 at 4:46 AM, Ashutosh Sharma ashu1979@gmail.com wrote:

Hi All,

I have a question regarding the index and search of the date time field
which store date with millisecond. Is there any known problem or issue if I
store the millisecond? I am using "yyyyMMdd’T’HHmmss.SSSZ" date format to
store the datetime value. As per my understanding, if we store the date
value with millisecond granularity, then the index size will be bigger than
if we don't store the millisecond. As there will be less number of unique
values. Searching is also get affected if we store millisecond data as
there are more number of docs to search.

Has someone face any issue with the date time with millisecond value. I
want to use the millisecond for the sorting of the results i.e. if there
are 100 docs within a second then it should be sort by the millisecond
value.

Please help me and provide your inputs.

Thanks
Ashu

--

--

On 12/17/2012 4:13 AM, Radu Gheorghe wrote:

Hi Ashu,

I've used millisecond timestamps and I didn't have any issues. Of
course, the index size would be slightly larger, but if you need
millisecond granularity, I think you should go for it.

Sure, sorting on date will be slower because there will be more unique
values to sort. But then, that's what you want in the first place, so
it's not like you're wasting resources.
Only if the data includes more actual, not just because there might be
more values.

If you are using a real date(stamp) field each sort comparison is the
same because each is a long, whether the number stored and sorted
resolves to a whole second or a fractional second.
The values are actually stored as a Long.

-Paul

--