ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Kasnacheev <ilya.kasnach...@gmail.com>
Subject Re: Storing short/empty strings in Ignite
Date Tue, 05 Mar 2019 10:08:55 GMT
Hello!

If you can modify your code to store nulls instead of empty strings, nulls
seem to be much more compact.

Regards,
-- 
Ilya Kasnacheev


вт, 5 мар. 2019 г. в 10:12, Valentin Kulichenko <
valentin.kulichenko@gmail.com>:

> Hey folks,
>
> While working with Ignite users, I keep seeing data models where a single
> object (row) might contain many fields (100, 200, more...), and most of
> them are strings.
>
> Correct me if I'm wrong, but per my understanding, for every such field we
> store an integer value to represent its length. This is significant
> overhead - with 200 fields we spend 800 bytes only for this.
>
> Now here is the catch: vast majority of those strings are actually empty or
> very short (several chars), therefore we don't really need 4 bytes to their
> length.
>
> My suggestions is to introduce another data type, e.g. STRING_SHORT, use it
> for all strings that are 255 chars or less, and therefore use a single byte
> to encode length. We can go even further, and also introduce STRING_EMPTY,
> which obviously doesn't need any length information at all.
>
> What do you guys think?
>
> -Val
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message