You didn't understand me.>> > How do I make a SAPDB case-insensitive? > > I could imagine a case-insensitive index by using a special > compare-function for strings: > for example "a" < "A" < "b" < "B" < "c" < "C" etc. > > That allows to search for a string "aBc" case-insensitive by > outputting all values in the interval ["abc";"ABC"]. > > The index still allowes search case-sensitive ... because "a"!="A" etc. > > Any ideas, why this should not be implemented?Because it's slow? (well for anything other than *very* short strings) Because there is a better way? Imagine a string 10 chars long, you'd get 1024 different versions of that by altering case of each letter, what would you do with that? make 1024 queries?
I was talking about implementing an indexing-algorthme that can handle case-insensitive search.
The Problem is, that usual "a"<"b"<"c" << "A"<"B"<"C" etc.
That's the natural Ordner within the most CharSets.
Usual, a Database uses that "natural" order to sort the strings within an Index:
"abba"<"buddy"<"ABBA"<"Buddy"
If you map the letters to mach the order "a"<"A"<"b"<"B"<"c"<"C" etc.
This will become
"abba"<"ABBA"<"buddy"<"Buddy"
As you can see, case-insensitivly identical strings are very near together.
All possible "abba"-string like "abba" "Abba" "aBba" ... are within the interval ["abba", "ABBA"].
That will make it very easy to search case-insensitively.
To take an 10char-string as an example:
if i want to search for "abcdEfGhjk" case-insensitiv, i will have to go into the index and return all values within the interval ["abcdefghjk", "ABDEFGHJK"] - that might be many, but as the elements in the index are ordered specially, the search doesn't take long.
The other problem is the length of the string.
"abb" is also within the interval ["abba", "ABBA"] if we take the usual string-compare. So it would be good, to sort the strings by length first:
"abb"<"ABB"<"abba"<"ABBA"
That index can be used to search for:
strings starting with expression x
string identical to expression x
both case-insensitive and case-sensitive
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general
