MySQL Forums
Forum List  »  German

Re: UPDATE in Kombination mit ORDER BY sehr langsam
Posted by: Thomas Wiedmann
Date: August 06, 2012 10:40AM

Um bei Performancefragen richtig helfen zu können, bedarf es folgender Informationen (für alle beteiligten Tabellen):
* SHOW CREATE TABLE tbl; -- liefert engine, indexes
* SHOW TABLE STATUS LIKE 'tbl'; -- liefert die Tabellengrößen
* EXPLAIN SELECT ...; -- EXPLAIN Ausgabe für den Zugriffpfad
* SHOW VARIABLES LIKE '%buffer%'; -- wichtige MySQL Server Einstellungen
Bitte SQL-Befehle und die diservev Ausgaben mit [ code ] [ / code ] (ohne die Leerzeichen) einklammer, sonst kann man das Ergebnis schlecht lesen.


mysql>SHOW CREATE TABLE highscores;

da es bei UPDATE (noch) keinen EXPLAIN gibt, bitte mal dies hier in der MySQL Console ausführen

EXPLAIN 
SELECT positionAlt, position
  FROM highscores
 WHERE spielmodus=1 
 ORDER BY siege DESC, niederlagen ASC, unentschieden DESC


Explain Beispiel
mysql> EXPLAIN select * from t;
+----+-------------+-------+------+---------------+------+---------+------+------+-------+
| id | select_type | table | type | possible_keys | key  | key_len | ref  | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+------+-------+
|  1 | SIMPLE      | t     | ALL  | NULL          | NULL | NULL    | NULL |    1 |       |
+----+-------------+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)

mysql>

Grüße
Thomas

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.