Ankündigung

Einklappen
Keine Ankündigung bisher.

[Erledigt] utf8_general_ci <> utf8_unicode_ci ?

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • [Erledigt] utf8_general_ci <> utf8_unicode_ci ?

    Hallo!

    Wo liegt der Unterschied zwischen den beiden folgenden MySQL-Kollationen?
    - "utf8_general_ci"
    - "utf8_unicode_ci"


  • #2
    Der Unterschied liegt (hauptsächlich) wie sortiert wird. Eine detaillierte Beschreibung gibt's hier: http://stackoverflow.com/questions/7...tf8-unicode-ci und da http://stackoverflow.com/questions/1...tf8-unicode-ci (siehe auch verlinktes Posting im MySQL-Forum)

    Performance-Vorteile bzw. -nachteile habe bis jetzt nicht wirklich real feststellen können, habe allerdings auch nicht gemessen. Der Hausverstand sagt einem aber, dass es da bestimmt andere Bereiche zur Optimierung gibt.

    Kommentar


    • #3
      Die Sortierreihenfolge von Umlauten iirc.
      [COLOR=#A9A9A9]Relax, you're doing fine.[/COLOR]
      [URL="http://php.net/"]RTFM[/URL] | [URL="http://php-de.github.io/"]php.de Wissenssammlung[/URL] | [URL="http://use-the-index-luke.com/de"]Datenbankindizes[/URL] | [URL="https://www.php.de/forum/webentwicklung/datenbanken/111631-bild-aus-datenbank-auslesen?p=1209079#post1209079"]Dateien in der DB?[/URL]

      Kommentar


      • #4
        So Fortgeschritten bist du wohl nicht, das steht in der Doku:

        http://dev.mysql.com/doc/refman/5.0/...code-sets.html

        For any Unicode character set, operations performed using the xxx_general_ci collation are faster than those for the xxx_unicode_ci collation. For example, comparisons for the utf8_general_ci collation are faster, but slightly less correct, than comparisons for utf8_unicode_ci. The reason for this is that utf8_unicode_ci supports mappings such as expansions; that is, when one character compares as equal to combinations of other characters. For example, in German and some other languages “ß” is equal to “ss”. utf8_unicode_ci also supports contractions and ignorable characters. utf8_general_ci is a legacy collation that does not support expansions, contractions, or ignorable characters. It can make only one-to-one comparisons between characters.
        Der wichtigste Unterschied ist, dass Beispielsweise ß und ss in general_ci gleich sind, was gefährlich werden kann (bsp. Login-Namen).

        Fazit: Möglichst immer unicode_ci verwenden.
        [URL="https://github.com/chrisandchris"]GitHub.com - ChrisAndChris[/URL] - [URL="https://github.com/chrisandchris/symfony-rowmapper"]RowMapper und QueryBuilder für MySQL-Datenbanken[/URL]

        Kommentar


        • #5
          @all: Danke

          Kommentar

          Lädt...
          X