Your formula is not correct.

yyyMMdd would map all values of a day to a single integer and you get
something like "sort by day" or "filter by day".

Assumed you have a normal distribution and you have a year of timestamps,
you can estimate: 80mio / 365 = 219.178 timestamps per day. In the "day
field", you have only 365 integers in the cache instead of 80mio longs for
unique millis. If "day" is too coarse, you can add an hour, minute, second
index.

Jörg



On Fri, Sep 26, 2014 at 1:21 PM, Anantha Govindarajan <
[email protected]> wrote:

> Hi,
>
> Initially we too used System.currentTimeInMillis() . Then we switched to 2
> int fields something like yyyyMMdd & HHmmssSSS.
>
> If query's time criteria  falls with in single date then we dont apply 
> *yyyyMMdd
> field* for sorting.  We have decent performance compared with
> System.currentTimeInMillis().
>
> Hi Jörg,
>
> How much memory will es take when applying aggregation on a long field
> which contains ~80 million (1000 * 60 * 60 * 24 unique millis in a day =
> 86400000 ) unique long values.
>
> If i understand correctly 80 million * 8 bytes for long . i.e., 86400000 *
> 8 = 691200000 (659 MB). Incase of yyyyMMdd as int field , 86400000 * 4
> = 345600000 (329 MB).
>
> What is the role of lucene's packedInt here in this case? Sorry if i
> missing something.
>
> Also we are using doc values with default option.
>
>
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/7e21797e-d5b9-4e9c-af90-58c693fad89b%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/7e21797e-d5b9-4e9c-af90-58c693fad89b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGg86_qMgymP3_g0XM8off7o3_PL-Ajp7hdkUjmepHygQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to