how to avoid sub-query to gain performance

2010-06-02 Thread Lin Chun
*hi* * * *i have a reporting query which have 2 long sub-query* SELECT r1.code_centre, r1.libelle_centre, r1.id_equipe, r1.equipe, r1.id_file_attente, r1.libelle_file_attente,r1.id_date, r1.tranche, r1.id_granularite_de_periode,r1.granularite, r1.ContactsTraites, r1.ContactsenParcage,

Re: how to avoid sub-query to gain performance

2010-06-02 Thread Perrin Harkins
On Wed, Jun 2, 2010 at 10:28 AM, Lin Chun franks1...@gmail.com wrote: *don't know it very clear, but i think is the problem of derived seems it take full scaning* Yes, it has no indexes so it isn't good for very large subqueries. You should create them as temporary tables instead and give them