On 22/11/2011 11:50, Lukas Masak (JIRA) wrote:
> computed index by substring function for long columns
> -----------------------------------------------------
>
>                   Key: CORE-3672
>                   URL: http://tracker.firebirdsql.org/browse/CORE-3672
>               Project: Firebird Core
>            Issue Type: Bug
>      Affects Versions: 2.1.4
>           Environment: win32
>              Reporter: Lukas Masak
>              Priority: Minor
>
>
> 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)))
>
This issue depends if we're allowed to change SUBSTRING with constant 
length to describe the result with that length instead of the value one, 
like we do with *PAD.

Accordingly to the standard, substring "should" be described as 
returning the same type of the value.


Adriano


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to