Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Too big builtin indexes in Datastore #41

@bprusak

Description

@bprusak

Datastore automatically makes builtin indexes for every field, even if we never make requests using that field (as in adding filters to the Query object, not by going through all the entries with Java code).
The problem is that for the fields that have long, complicated content (i.e. description and ingredients) the index grows very fast.
It is normal that an index is bigger than the content it spans over (especially in small databases), but our indexes are excessive: for 13 entries that take 3.44 KB of space we have 22.41KB of indexes. 15.38KB of these indexes are for the description and ingredients fields, and we can drop those as we're not using them.

To avoid making indexes for these fields, we can use setExcludeFromIndexes() while writing new data. That means that not only do we need to add that to our Java code, we also need to re-do (delete and add again) all existing entries for that to work fully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions