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

store UUIDs as optimized binary(16) instead of varchar(32) #111

Open
jeromecc opened this issue Nov 21, 2017 · 3 comments
Open

store UUIDs as optimized binary(16) instead of varchar(32) #111

jeromecc opened this issue Nov 21, 2017 · 3 comments
Assignees

Comments

@jeromecc
Copy link
Contributor

jeromecc commented Nov 21, 2017

space

switch to binary(16) for space, it is particularly relevant for databases using utf8mb4 (130 bytes instead of 16 bytes when dashes removed and UNHEX(value)

performance

If UUIDs of type 1 were issued by the server, we could rearrange the 4 hex digits groups to improve index performance and use UUIDs as primary keys for the user and patient tables 1.
Current version of UUID used is 4 (totally random). Should we use type 1, created by the database, to improve indexing? For this performance improvement, UUIDs should be generated by the same machine (the MySQL server).
We could do this in the future:

  • when MySQL 8 becomes available in Debian/Ubuntu: it supports UUID_TO_BIN/BIN_TO_UUID
  • when SQLite is discontinued
@jeromecc jeromecc self-assigned this Nov 21, 2017
@jeromecc
Copy link
Contributor Author

We can move to type 1 UUID immediately without rewrite anything else than 1 function and without breaking anything.

@jeromecc
Copy link
Contributor Author

In fact Qt cannot easily create UUIDs of type 1. Let's keep type 4 until we get rid of SQLite, then we will use the RDBMS (My/Maria) to generate type 1 UUIDs.

jeromecc added a commit that referenced this issue Nov 25, 2017
@jeromecc
Copy link
Contributor Author

fhio v0.11 will use uuids stored binary(16) in patients database (PATIENT_IDENTITY table). To simplify database update, other changes will be implemented once SQLite is discontinued.

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

No branches or pull requests

1 participant