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

computed index by substring function for long columns [CORE3672] #4022

Closed
firebird-automations opened this issue Nov 22, 2011 · 8 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

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"

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

What is the definition (data type & length) of "Col1"?

@firebird-automations
Copy link
Collaborator Author

Commented by: Lukas Masak (lmasak)

CREATE TABLE tbl_test
(
col1 varchar(2000) COLLATE UTF8
);

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA568 [ QA568 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: 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:
"-key size exceeds implementation restriction"

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

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

2 participants