[ 
https://issues.apache.org/jira/browse/LUCENE-6086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Adrien Grand updated LUCENE-6086:
---------------------------------
    Attachment: LUCENE-6086.patch

The idea behing this encoding is that longs are often used to store timestamps, 
and that floats and doubles often store simple integral values. Here is a patch 
and a quick summary of the improvements.

Float value representing an integer in -63..63:
 - trunk: 4 bytes
 - patch: 1 byte

Other positive float values:
 - trunk: 4 bytes
 - patch: 4 bytes

Other negative float values:
 - trunk: 4 bytes
 - patch: 5 bytes

Double value representing an integer in -63..62:
 - trunk: 8 bytes
 - patch: 1 byte

Double value that can be represented exactly with a float (eg. 1000, 0.25)
 - trunk: 8 bytes
 - patch: 5 bytes

Other positive double values:
 - trunk: 8 bytes
 - patch: 8 bytes

Other negative double values:
 - trunk: 8 bytes
 - patch: 9 bytes

Long values use zig-zag encoding with some optimizations for timestamps. So for 
instance a number in -16..15:
 - trunk: 8 bytes
 - patch: 1 byte

Now with second-level precision:
 - trunk: 8 bytes
 - patch: 5 bytes

Now with hour-level precision:
 - trunk: 8 bytes
 - patch: 4 bytes

Today (day precision):
 - trunk: 8 bytes
 - patch: 3 bytes

> Minor optimizations to the encoding of numerics in stored fields
> ----------------------------------------------------------------
>
>                 Key: LUCENE-6086
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6086
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>             Fix For: 5.0
>
>         Attachments: LUCENE-6086.patch
>
>
> LUCENE-5914 explored minor optimizations for numeric encoding in stored 
> fields, I think we should try to push them to the default format.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to