Hallo zusammen,
seit einiger Zeit bin ich dabei, unser seit nun einigen Jahren gewachsenes OTRS zu optimieren.
Dabei bin ich über ein kurioses Verhalten bei Abfragen in der MySQL-Datenbank "gestolpert":
Bei Abfragen, welche eine "LOWER" Anweisung mitgeben, wird scheinbar der hinterlegte Index nicht berücksichtigt!
Beispiel:
SELECT profile_name FROM search_profile WHERE LOWER(login) = LOWER('TicketSearch::Benutzer1');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE search_profile ALL NULL NULL NULL NULL 9254 Using where
SELECT profile_name FROM search_profile WHERE (login) = LOWER('TicketSearch::Benutzer1');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE search_profile ref login login 602 const 5 Using where
Könnt ihr dies nachvollziehen und vielleicht sogar bestätigen?
Ich bin kein DB-Experte, aber lässt sich so ein Index auch "anders" setzen (so dass z.B. ein "LOWER-Index" für die Spalte "Login" erstellt wird?)
Die eigentliche Anweisung aus OTRS heraus lässt sich ermutlich nicht einfach so ohne weiteres ändern (LOWER Anweisung entfernen, was aber vielleicht auch gar nicht sinnvoll wäre), oder?
Ich hoffe meine Anfrage hat noch genügend Bezug zu OTRS, obwohl sie ja schon sehr auf Datenbank-spezifische Aspekte abzielt
Vielen Dank im voraus für eure "Ideen"
MySQL Statement mit "LOWER" umgeht vorhandenen Index
MySQL Statement mit "LOWER" umgeht vorhandenen Index
OTRS: 2.4.9 + ITSM 2.1.1 + CiCS 3.3.5
SLES 11
MySQL-Version: 5.1.49
SLES 11
MySQL-Version: 5.1.49
Re: MySQL Statement mit "LOWER" umgeht vorhandenen Index
huntingbears.nl - @michielbeijen on Twitter
Re: MySQL Statement mit "LOWER" umgeht vorhandenen Index
Yes, I've already seen this
I didn't know about the "bugtracker" when I wrote the post in the OTRS Forum.
I'm excited if that will be fixed at least in OTRS 3.X!
Anyway, thanks for your comment and note
I didn't know about the "bugtracker" when I wrote the post in the OTRS Forum.
I'm excited if that will be fixed at least in OTRS 3.X!
Anyway, thanks for your comment and note
OTRS: 2.4.9 + ITSM 2.1.1 + CiCS 3.3.5
SLES 11
MySQL-Version: 5.1.49
SLES 11
MySQL-Version: 5.1.49