MySQL Forums
Forum List  »  German

Re: Subquery returns more than 1 row
Posted by: Thomas Wiedmann
Date: January 13, 2012 04:42AM

Hallo Mark,

zumeist ist der SQL nicht allein schuld daran, das eine Abfrage langsam ist, sondern der fehlende oder falsche Index auf den Tabellen etc.

Mach am Besten einen neuen Thread auf, mit Folgendem:
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

Beispiel EXPLAIN..

mysql> EXPLAIN SELECT * FROM kunde;
+----+-------------+-------+--------+---------------+------+---------+------+------+---------------------+
| id | select_type | table | type   | possible_keys | key  | key_len | ref  | rows | Extra               |
+----+-------------+-------+--------+---------------+------+---------+------+------+---------------------+
|  1 | SIMPLE      | kunde | system | NULL          | NULL | NULL    | NULL | 0    | const row not found |
+----+-------------+-------+--------+---------------+------+---------+------+------+---------------------+
1 row in set (0.19 sec)

mysql>
Bitte die Ausgabe oder den SQL-Code sauber formatieren mit [ code ] [ / code ] (ohne Leerzeichen), sonst kann man es nur schwer lesen.

Grüße
Thomas

Options: ReplyQuote


Subject
Views
Written By
Posted
3110
December 15, 2011 08:48AM
1787
December 15, 2011 12:41PM
1608
January 06, 2012 09:51AM
1262
January 11, 2012 03:55AM
1294
January 11, 2012 08:26AM
1498
January 12, 2012 04:52AM
2047
January 12, 2012 06:33AM
1529
January 13, 2012 03:27AM
Re: Subquery returns more than 1 row
1917
January 13, 2012 04:42AM


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.