MySQL Forums
Forum List  »  Performance

Preformace problem (maybe bug?) with multiple join on same table
Posted by: Joerg Plenert
Date: March 31, 2005 09:16AM

Hi !

select t0.a, t1.b, t2.b, t1.c, t3.b FROM `tab1` as t0 LEFT JOIN `tab2` as t1 ON t0.a = t1.a LEFT JOIN `tab3` as t2 ON t1.b = t2.a LEFT JOIN `tab4` as t3 ON t1.c = t2.a

is very slow.

Explain says

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 index Lst 5 5650 Using index
1 SIMPLE t1 eq_ref PRIMARY,a PRIMARY 4 oc_dsu.t0.a 1 (null)
1 SIMPLE t2 eq_ref PRIMARY,a PRIMARY 4 oc_dsu.t1.b 1 (null)
1 SIMPLE t3 index bezeichnung 75 914 Using index

where the last looks scary !?

If I don't use t3 the speed is fine!

Using 4.1.10a

Is that a bug, a feature or just a poor select statement !?


Joerg Plenert

Options: ReplyQuote

Written By
Preformace problem (maybe bug?) with multiple join on same table
March 31, 2005 09:16AM

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.