MySQL Forums
Forum List  »  French

Select à 2 vitesses
Posted by: Duke Kahanamoku
Date: December 02, 2010 07:01AM

Bonjour,

Je teste cette requête sur mon serveur et j'ai des temps de réponse vraiement différent et incompréhensible.
Voici la requête :
set @tel = '0143442789';
(SELECT 2 as Type, CNOM as Nom, IDAUTO as IDAUTO, CNUMERO as Numero FROM table1 WHERE CDEST1TEL1 = @tel OR CDEST1TEL2 = @tel OR CDEST2TEL1 = @tel OR CDEST2TEL2 = @tel OR CDEST3TEL1 = @tel OR CDEST3TEL2 = @tel)
union
(SELECT 1 , DNOM, IDAUTO, DNUMERO FROM table2 WHERE DTEL1 = @tel OR DTEL1INDEX = @tel OR DTEL2 = @tel OR DTEL2INDEX = @tel OR DTEL3 = @tel OR DTEL3INDEX = @tel)
union
(SELECT 3 , TRAISON, IDAUTO, TSIRET FROM table4 WHERE TTEL1 = @tel OR TTEL2 = @tel OR TTEL3 = @tel)
union
(SELECT 4 , TRAISON, IDAUTO, DONUMERO FROM table3 WHERE TTEL1 = @tel OR TTEL1INDEX = @tel OR TTEL2 = @tel OR TTEL2INDEX = @tel OR TTEL3 = @tel OR TTEL3INDEX = @tel)
;

Quand je lance pour la première fois cette requête elle me fait un retour de 20 secondes. Quand ensuite je relance cette même requête mais avec en plus un numéro de téléphone différent, j'ai un retour en 2 secondes.

Qu'est ce qui peut expliquer cette différence ?
Existe t'il un moyen d'obtenir 2 secondes de traitement dans tous les cas ?

Merci de votre aide.

Options: ReplyQuote


Subject
Views
Written By
Posted
Select à 2 vitesses
2989
December 02, 2010 07:01AM


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.