MySQL Forums
Forum List  »  Views

Views with Joins very slow
Posted by: Hans Stegmüller
Date: August 19, 2005 06:03AM

Hello,

I habe trouble with views. I create a view with the following statement:

CREATE VIEW Kundendaten.kunden_to_b7 AS
SELECT Kundendaten.kundendaten.Nr AS Nr,
Kundendaten.zuordnungprogrammkey.NameKurz AS NameKurz
FROM ((Kundendaten.kundendaten
JOIN Kundendaten.zuordnungkundeprogramm
ON ((Kundendaten.kundendaten.Nr = Kundendaten.zuordnungkundeprogramm.KNR)))
JOIN Kundendaten.zuordnungprogrammkey
ON ((Kundendaten.zuordnungkundeprogramm.PCode =
Kundendaten.zuordnungprogrammkey.Code)))
WHERE (Kundendaten.zuordnungprogrammkey.NameKurz = _utf8'B7');

The names are not important, the structure is always the same. The result should be a view with all customers of one specific program. The program name ist not defined directly, therefore we have a second JOIN. The table "zuordnungkundeprogramm" has about 400.000 entries.

I have two databases. On one database the SQL command is working, but very slow, on the other database the server crashes. No answer is possible, you have to switch off the server and restarting the machine.

Hope, somebody can show me a solution. Remark: The same statements are running on ACCESS without any problems, and also pretty fast.

Options: ReplyQuote


Subject
Views
Written By
Posted
Views with Joins very slow
5109
August 19, 2005 06:03AM
2341
August 19, 2005 06:39AM
2286
August 23, 2005 10:19AM


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.