Hi,
seit dem ich MySQL 5 (Version 0.24, mit 0.18 hatte ich aber die gleichen Probleme) installiert habe habe ich extreme Probleme mit dem ausführen von komplexeren Querys. Ich kann meine Seite auf meinem Testserver quasi nicht mehr laufen lassen, teilweise braucht der 120 Sekunden um ein query auszuführen, ich hab hier mal ein Beispiel:
SELECT musik . * , users.str_username, artists.str_email, artists.artist_id, artists.str_name, judge.dti_datetime AS lastjudge, judge.user_id AS lastjudge_user_id, (
SELECT SUM( subjudge1.bol_stay )
FROM judge AS subjudge1
WHERE subjudge1.judged_id = musik.musik_id
AND subjudge1.str_section = 'musik'
GROUP BY subjudge1.judged_id
LIMIT 1
) AS stay_yes, (
SELECT COUNT( subjudge2.bol_stay )
FROM judge AS subjudge2
WHERE subjudge2.judged_id = musik.musik_id
AND subjudge2.str_section = 'musik'
GROUP BY subjudge2.judged_id
LIMIT 1
) AS stay_gesamt, (
SELECT AVG( subjudge3.int_judge )
FROM judge AS subjudge3
WHERE subjudge3.str_section = 'musik'
AND subjudge3.judged_id = musik.musik_id
AND subjudge3.int_judge IS NOT NULL
GROUP BY subjudge3.judged_id
) AS avg_judge, (
SELECT COUNT( subjudge4.judge_id )
FROM judge AS subjudge4
WHERE subjudge4.str_section = 'musik'
AND subjudge4.judged_id = musik.musik_id
) AS judge_count
FROM musik
INNER JOIN artists ON ( artists.artist_id = musik.artist_id )
INNER JOIN artists_auth ON ( artists_auth.artist_id = artists.artist_id
AND artists_auth.bol_founder = '1' )
INNER JOIN users ON ( users.user_id = artists_auth.user_id )
LEFT JOIN judge ON ( judge.judged_id = musik.musik_id
AND judge.str_section = 'musik' )
WHERE bol_active = '1'
AND (
judge.dti_datetime = (
SELECT dti_datetime
FROM judge AS subjudge
WHERE subjudge.judged_id = musik.musik_id
AND subjudge.str_section = 'musik'
ORDER BY subjudge.dti_datetime DESC
LIMIT 1 )
OR judge.dti_datetime IS NULL
)
GROUP BY musik.musik_id
ORDER BY musik.dti_datetime DESC
LIMIT 0 , 5
Diese Abfrage dauerte 108 Sekunden. Das kann doch nicht sein, bei meinem Online Server braucht sie 2 Sekunden, mit MySQL 4.1.7.
Hat jemand eine Idee was da los sein kann? Oder muss ich mir wieder MySQL 4 installieren, was aber ja wiedersinnig wäre.
Danke für eure hilfe,
NBOne
seit dem ich MySQL 5 (Version 0.24, mit 0.18 hatte ich aber die gleichen Probleme) installiert habe habe ich extreme Probleme mit dem ausführen von komplexeren Querys. Ich kann meine Seite auf meinem Testserver quasi nicht mehr laufen lassen, teilweise braucht der 120 Sekunden um ein query auszuführen, ich hab hier mal ein Beispiel:
SELECT musik . * , users.str_username, artists.str_email, artists.artist_id, artists.str_name, judge.dti_datetime AS lastjudge, judge.user_id AS lastjudge_user_id, (
SELECT SUM( subjudge1.bol_stay )
FROM judge AS subjudge1
WHERE subjudge1.judged_id = musik.musik_id
AND subjudge1.str_section = 'musik'
GROUP BY subjudge1.judged_id
LIMIT 1
) AS stay_yes, (
SELECT COUNT( subjudge2.bol_stay )
FROM judge AS subjudge2
WHERE subjudge2.judged_id = musik.musik_id
AND subjudge2.str_section = 'musik'
GROUP BY subjudge2.judged_id
LIMIT 1
) AS stay_gesamt, (
SELECT AVG( subjudge3.int_judge )
FROM judge AS subjudge3
WHERE subjudge3.str_section = 'musik'
AND subjudge3.judged_id = musik.musik_id
AND subjudge3.int_judge IS NOT NULL
GROUP BY subjudge3.judged_id
) AS avg_judge, (
SELECT COUNT( subjudge4.judge_id )
FROM judge AS subjudge4
WHERE subjudge4.str_section = 'musik'
AND subjudge4.judged_id = musik.musik_id
) AS judge_count
FROM musik
INNER JOIN artists ON ( artists.artist_id = musik.artist_id )
INNER JOIN artists_auth ON ( artists_auth.artist_id = artists.artist_id
AND artists_auth.bol_founder = '1' )
INNER JOIN users ON ( users.user_id = artists_auth.user_id )
LEFT JOIN judge ON ( judge.judged_id = musik.musik_id
AND judge.str_section = 'musik' )
WHERE bol_active = '1'
AND (
judge.dti_datetime = (
SELECT dti_datetime
FROM judge AS subjudge
WHERE subjudge.judged_id = musik.musik_id
AND subjudge.str_section = 'musik'
ORDER BY subjudge.dti_datetime DESC
LIMIT 1 )
OR judge.dti_datetime IS NULL
)
GROUP BY musik.musik_id
ORDER BY musik.dti_datetime DESC
LIMIT 0 , 5
Diese Abfrage dauerte 108 Sekunden. Das kann doch nicht sein, bei meinem Online Server braucht sie 2 Sekunden, mit MySQL 4.1.7.
Hat jemand eine Idee was da los sein kann? Oder muss ich mir wieder MySQL 4 installieren, was aber ja wiedersinnig wäre.
Danke für eure hilfe,
NBOne