Xavier BEAUDOUIN wrote:
>
> Hello !
>
> Trying to make 3 joins with mysql, we get a lot slowdowns, for small
> amount of data (about 200 entries)...
>
> eg :
>
> mysql> select r1.prix,revendeur.nom from materiel,r1,revendeur where
> materiel.nummat='200' and materiel.nummarq='932' and
> materiel.numprix=r1.numprix and r1.numrevend=revendeur.numrevend;
> +------+---------------------------------+
> | prix | nom |
> +------+---------------------------------+
> | 950 | DIRECT PRICE |
> | 695 | NGC |
> | 860 | BEST SOURCE INTERNATIONAL (BSI) |
> | 1050 | ASIE MICRO |
> | 869 | P6 MICRO |
> | 1020 | LITEC COMPUTER |
> | 850 | MICRO HOUSE |
> | 895 | GROSBILL MICRO |
> | 889 | EXCELAND MICRO |
> | 875 | CHARLIE 12 |
> +------+---------------------------------+
> 10 rows in set (17.41 sec)
>
> We are using MySQL 3.21.33b on debian/linux x86 on a PII/266 with 128MB of
> RAM...
>
> Is there any way to make this really fast ?
>
> Thanks a lot
>
> /Xavier
Hi Xavier
Do you have the following KEYs?
On table materiel: KEY (nummat,nummarq,numprix)
On table rl: KEY (numprix,numrevend)
If not add them.
You always can check a particular SQL statement with the EXPLAIN syntax.
Tschau
Christian
| Thread |
|---|
| • slowdown | Xavier BEAUDOUIN | 19 May |
| • Re: slowdown | Christian Mack | 19 May |