Sven Köhler wrote

> > select a.id_bundesland, b.bundesland from base_bundesländer 
> a left join 
> > (select id_bundesland, bundesland from base_bundesländer_lang where 
> > id_sprache=1) b on (a.id_bundesland=b.id_bundesland) order by 
> > b.bundesland desc
> 
> i found out, that the query above should match
> select a.id_sprache, b.sprache from base_sprachen a left join 
> base_sprachen_lang b on (a.id_sprache=b.id_sprache AND 
> b.id_sprache2=2) 
> order by a.reihenfolge desc
> 
> which should perform better according to it's explain output.
> shouldn't the optimizer be abled to recognize this?

It should but unfortunately there is no query rewrite within SAP DB.
So everey subquery is optimized separatly. 
There are some plans to implement query rewrite but it's a long way 
to go so don't expect it in the near future.

Kind regards,
Holger
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to