Limit all fields with varchar of 255 characters to 190 unicode characters. #2151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With utf8-mb4, it is not possible to index many fields that are 255 characters length, since the index is limited to 767 bits, so 191 characters.
Initially, i had a big performance issue on media-type: i have some bases with more than 500000 files, that are archives scanned page by page, and a simple
select distinct media_type from media
take more than 5 seconds, but that is instant with an index. So the first commit fixes this point.The next one fixes other fields with the same limit, but i didn't add indexes for now (but i think i need some of them, like ingester/renderer, extension, etc., and
type
andlang
in the tablevalue
should be 190 characters too to be indexed.The last commit does the same for some labels and names, but they are less important since the biggest table are media and value.