-
-
Notifications
You must be signed in to change notification settings - Fork 497
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
uuid's should be stored in a BINARY(16) field using doctrine for optimal performance. #63
Comments
Let's hold off on that PR for right now. I have #51 open right now. I should be able to get to that tonight, which will involve completely separating the Doctrine UUID type into its own separate library. |
What I meant to say was: once I separate the Doctrine type into a separate lib, then you may send the PR against that lib. :-) |
Great! You can give me a poke when this is done :) |
In my opinion that should be a setting. We're very happy with our textual representation of UUIDs in the database. It makes support/debugging a lot easier. |
Both types could be added in the library. something like |
👍 |
I very much agree with both possibilities. Doctrine MongoDB ODM stores them in a binary format, which makes it really hard to work with if you need to do queries outside your code, and it would be a major BC break, so +1 for choice uuid_binary type |
Thanks for your patience. I've created ramsey/uuid-doctrine and have moved the relevant code there. It's all set up and ready to go. Feel free to make your pull request there. |
It would be more performant to save the data in a
BINARY(16)
field then in aCHAR(36)
field.There are some benchmarks in here: http://iops.io/blog/storing-billions-uuid-fields-mysql-innodb/
And some info here: https://stackoverflow.com/questions/10950202/how-to-store-uuid-as-number
I think it should be rather easy to implement this in the convertToPHPValue and convertToDatabaseValue fields. If you're interested, I'll create a pull request for this.
The text was updated successfully, but these errors were encountered: