IDENTITY collation
The IDENTITY collation is a simple binary comparison of the values.
Strings are ordered by the computer's internal representation of the data. This produces a result that is not meaningful in any language.
Substring matching is also done using the internal representation of the string. This means that two substrings will only be considered a match if they are byte-for-byte identical. Linguistic and cultural rules will not be considered.
- Advantages
- Fastest collation available.
- Disadvantages
- The order is not linguistic.
- Substring matching is not linguistic.
- Character and graphic types are ordered differently.
IDENTITY collation is suitable when linguistic correctness is not important for the database and applications, or when the absolute best performance is vital.
Examples
The database with IDENTITY collation was created using
the following command: CREATE DATABASE TESTDB COLLATE USING
IDENTITY
.
Sorting:
SELECT WORD FROM TESTDATA ORDER BY WORD
WORD
----------
C◌̌ech
Jana
Jaroslav
cena
chleb
c◌̌as
hlava
holub
jaro
Čech
čas
- Upper and lower case letters are not grouped together.
- Accented characters are grouped separately from unaccented characters.
- Characters with combining accents are grouped with the unaccented characters.
- The word chleb is incorrectly grouped with words starting with c.
Substring matching:
SELECT WORD FROM TESTDATA WHERE WORD LIKE 'c%'
WORD
----------
cena
chleb
c◌̌as
- The word c◌̌as is selected, even though it starts with the character č and not the character c.
- The word chleb is selected, even though the digraph ch does not linguistically match the letter c.