Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum datatype (v1) #2039

Merged
merged 43 commits into from
Jun 19, 2024
Merged

Enum datatype (v1) #2039

merged 43 commits into from
Jun 19, 2024

Conversation

Ignition
Copy link
Contributor

@Ignition Ignition commented May 14, 2024

Introduce the Enum datatype.

  • Compact representation for a finite set of members
  • Semantically more meaningful than ints
  • More performant than string comparisons

Expected that if user has less than 256 named enums, each with less than 256 values, then their property store value representation will be 2 bytes for any enum value used. This will be better than string encoding, where "London" would be 7 bytes (1B size + 6 for the text).

Example commands

CREATE ENUM Location VALUES { York, Zagreb };
ALTER ENUM Location ADD London;
ALTER ENUM Location UPDATE VALUE London TO Westminster;
MATCH (n {city: Location::York}) RETURN n;

@Ignition Ignition added feature feature Docs needed Docs needed labels May 14, 2024
@Ignition Ignition added this to the mg-v2.17.0 milestone May 14, 2024
@Ignition Ignition force-pushed the enum branch 5 times, most recently from 579b735 to 49d3184 Compare May 17, 2024 12:18
@gitbuda gitbuda modified the milestones: mg-v2.17.0, mg-v2.18.0 May 20, 2024
@Ignition Ignition force-pushed the enum branch 4 times, most recently from 26044f4 to 0862b3c Compare May 21, 2024 11:41
@Ignition
Copy link
Contributor Author

Ignition commented May 21, 2024

Tracking

Documentation checklist

  • Add the documentation label tag
  • Add the bug / feature label tag
  • Add the milestone for which this feature is intended
  • Write a release note, including added/changed clauses
    • Added new enum data type
  • Link the documentation PR here
  • Tag someone from docs team

Extra work

  • @MarkoBarisic Can you add https://github.com/rollbear/strong_type.git to our cache

@Ignition Ignition force-pushed the enum branch 3 times, most recently from b30e4a5 to d8a08ab Compare May 23, 2024 12:45
@Ignition Ignition linked an issue May 23, 2024 that may be closed by this pull request
15 tasks
@Ignition Ignition force-pushed the enum branch 4 times, most recently from f239227 to 2f7795a Compare May 31, 2024 11:06
@Ignition Ignition force-pushed the enum branch 5 times, most recently from 8baf05f to e575f87 Compare June 7, 2024 08:51
@kgolubic
Copy link
Contributor

kgolubic commented Jun 19, 2024

@Ignition I'm missing the Release note entry and documentation PR.

Update: docs PR is memgraph/documentation#852

Copy link

sonarcloud bot commented Jun 19, 2024

@Ignition Ignition changed the title [Feature] Enum datatype Enum datatype (v1) Jun 19, 2024
@Ignition Ignition added this pull request to the merge queue Jun 19, 2024
Merged via the queue into master with commit 4d9d767 Jun 19, 2024
13 checks passed
@Ignition Ignition deleted the enum branch June 19, 2024 16:39
@kgolubic
Copy link
Contributor

kgolubic commented Jul 1, 2024

For Release note I'll use:

  • The support for the Enum datatype has been added. Enums can be used to enhance query performance and reduce memory usage compared to string representations.
    #2039

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs needed Docs needed feature feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EPIC] Enum datatype
5 participants