-
Couldn't load subscription status.
- Fork 13
Support combined unique per store key #944
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
base: master
Are you sure you want to change the base?
Conversation
|
I've heavily optimised the query now, due to no longer using where not and concat it can take full advantage of the indexes. See the explain of a query heavily dependent on this feature:
As you can see every subquery uses the index. |
|
Do we need some unit tests for this so we're sure the results are the same? |
This PR adds support for a combined
uniquePerStoreKeyNot every database table has a single field which is duplicate with multiple stores, but unique otherwise.
An example of what this could work with before is the
catalog_product_entity_media_gallery_valuevalue_idis completely unique except forstore_idwhere it can have the samevalue_idAn example where this wouldn't work before is the
catalog_product_entity_varchartable.Where an entry is unique per store only when
attribute_idandentity_idare combined. Since anattributecan have values attached and a product can also have multiple values attached, but a product cannot have multiple values of the same attribute attached.An example of it's usage in that case would be: