> -----Original Message-----
> From: Adriano dos Santos Fernandes [mailto:adrian...@gmail.com] 
> Sent: Lunes, 28 de Noviembre de 2011 16:08
> >
> No. It happens with large varchar column. So it turns back to my 
> question: can we describe a column with a length we know will fit and 
> will have no side effects other than just being described different?

I tried to do that in my first implementation, but then we have a problem:
substring with parameters. Should
substring(s from :n for :m)
use the max length from "s" and
substring(s from 5 for 10)
use 10 if length(s) > 10 ???


> Sure, a different descriptor would have no side effect in the 
> index, but 
> a change would be valid for any usage of substring.

Yes and the problem is that for an expression index to be used, AFAIK the
search expression should be identical, hence if somebody wants to use an
index created as
CREATE INDEX IDX1 ON tbl_test COMPUTED BY (CAST(SUBSTRING(col1 from 1 for
20) as varchar(20))) 
the user should write
where CAST(SUBSTRING(col1 from 1 for 20) as varchar(20)) = 'something'

Not very elegant.
 
> Or the issues should just be considered as an implementation limit of 
> our index...

Changing that may affect code that app developers have made for years.
Somebody may be relying on the fact that substring's result and the original
column have the same length (and it's documented).

C.


------------------------------------------------------------------------------
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