Subject | Re: [firebird-support] Issues in string indexing |
---|---|
Author | Helen Borrie |
Post date | 2006-02-15T07:53:53Z |
At 04:45 PM 15/02/2006, you wrote:
space characters are ignored when varchars are stored. To store
'abc' and 'abc ' and have them treated as distinct, the column would
have to be char. (But what a crazy idea!)
space characters are ignored for equivalence tests.
characters (making 'abc', 'abc ' and 'abc ' three distinct values)
but nothing is going to help you to get past the equivalence test
rules. It is just not at all a bright idea to allow trailing white
space to be meaningful.
will use the index with this predicate if it considers it useful. Of
course, once you get to storing random numbers of whitespace
characters in your char columns, it won't be easy to work out which is which.
./heLen
>Hi,Correct. You have defined this column as varchar. Trailing white
>
>I am storing strings in the database table and indexing them. (all
>of them are less than 252 characters). Now if have the following
>string already in the table
>"abc"
>and i try to insert another string "abc " which is differnt than
>what is there in the database, it does not allow me to put that in the
>database.
space characters are ignored when varchars are stored. To store
'abc' and 'abc ' and have them treated as distinct, the column would
have to be char. (But what a crazy idea!)
>When i equate the two string "abc" = "abc " that also matches. So isIt's designed like that, as per the SQL standard. Trailing white
>it a bug or it is designed like this.
space characters are ignored for equivalence tests.
>If I have strings like that and i want to insert it into theWell, define the fields as char to *store* the trailing white space
>databsae how do i solve this problem.
characters (making 'abc', 'abc ' and 'abc ' three distinct values)
but nothing is going to help you to get past the equivalence test
rules. It is just not at all a bright idea to allow trailing white
space to be meaningful.
>If I use LIKE then it works fine but the trade off will be i don'tYou could use STARTING WITH if you must do this thing. The optimizer
>have to use indexing then which will be big loss i suppose.
will use the index with this predicate if it considers it useful. Of
course, once you get to storing random numbers of whitespace
characters in your char columns, it won't be easy to work out which is which.
./heLen