Mailinglisten-Archive |
> hab da mal eine frage zu einem Left Join über 3 Tabellen!
> Hier mal der Join komplett:
>
> select count(*), b.catParent from tblCats as a left join tblCats as b on
> (b.catParent=a.catChild) left join tblSearch_quick
> on(sqCategory=b.catChild), tblItems where a.catParent=3 and match (sqTitle,
> sqDesc) AGAINST ('spielfilm ' in boolean mode) and itNum = sqNum group by
> b.catParent
>
> dieser Join braucht ganze 1m 55 sec
>
> der selber join ohne den Fulltext suche dauert nur 1.64 sec
>
> myisamchk -r habe ich heute durchgeführt!
>
> hier mal der explain:
> +-----------------+----------+---------------+--------------+---------+-----
> -------+------+----------------------------------------------+
> | table | type | possible_keys | key | key_len | ref
> | rows | Extra |
> +-----------------+----------+---------------+--------------+---------+-----
> -------+------+----------------------------------------------+
> | a | ref | catParent | catParent | 4 |
> const | 7 | Using where; Using temporary; Using filesort |
> | b | ref | catParent | catParent | 4 |
> a.catChild | 10 | |
> | tblSearch_quick | fulltext | sqCategory | Beschreibung |
> 0 | | 1 | Using where |
> +-----------------+----------+---------------+--------------+---------+-----
> -------+------+----------------------------------------------+
für mich ein total verhauenes query...
SELECT COUNT(*),
b.catParent
FROM tblCats AS a
LEFT JOIN tblCats AS b
ON b.catParent = a.catChild
LEFT JOIN tblSearch_quick
ON sqCategory = b.catChild,
tblItems
WHERE a.catParent = 3
AND MATCH (sqTitle, sqDesc) AGAINST ('spielfilm ' in boolean mode)
AND itNum = sqNum
GROUP BY b.catParent
vielleicht könntest du noch die tabellen struktur mit schicken damit man
überhaupt sieht was hier passiert...
--
Sebastian Mendel
www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com
--
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->> http://www.4t2.com/mysql
php::bar PHP Wiki - Listenarchive