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
computed index by substring function for long columns [CORE3672] #4022
Comments
Commented by: Sean Leyne (seanleyne) What is the definition (data type & length) of "Col1"? |
Commented by: Lukas Masak (lmasak) CREATE TABLE tbl_test |
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Alpha 1 [ 10331 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] Test Details: Confirmed in 2.5.5 (29-may-2015): attempt to create COMPUTED_BY index on expressions that involves UTF8-field with declared length = 169 characters (and page_size = 4K) produced: |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Lukas Masak (lmasak)
Is related to QA568
It is not possible to use substring function to create computed index for large columns.
CREATE INDEX IDX1 ON tbl_test COMPUTED BY (SUBSTRING(col1 from 1 for 20))
will fail with message: key size exceeds implementation restriction for index "IDX1"
select char_length( SUBSTRING(col1 from 1 for 20)) from tbl_test returns 20 so I was expecting index to work.
workaround
CREATE INDEX IDX1 ON tbl_test COMPUTED BY (CAST(SUBSTRING(col1 from 1 for 20) as varchar(20)))
Commits: d50019f c90e3a8 86d787b
====== Test Details ======
Confirmed in 2.5.5 (29-may-2015): attempt to create COMPUTED_BY index on expressions that involves UTF8-field with declared length = 169 characters (and page_size = 4K) produced:
"-key size exceeds implementation restriction"
The text was updated successfully, but these errors were encountered: