Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INNER JOIN or Sub-query?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
INNER JOIN or Sub-query?
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01105835
Message ID:
01105835
Vues:
59
Hi everybody,

Here is the SQL I'm using
SELECT <<m.lcFieldList>> ;
	FROM TRANS INNER JOIN Trans_employees_queues ;
	ON Trans.cTrans_pk = Trans_employees_queues.cTrans_fk ;
	INNER JOIN UsGrLink ON ;
	Trans_employees_queues.cCommission_owner_usgrlink_fk = Usgrlink.cUsgrlink_pk ;
	INNER JOIN USERS ON Users.iID = Usgrlink.iUserID ;
	<<m.tcAdditionalJoin>> ;
	INNER JOIN Employee_queue_schedules ;
	ON Trans_employees_queues.cTrans_employees_queues_pk = ;
	Employee_queue_schedules.cTrans_employees_queues_fk ;
	WHERE <<m.lcFilter>> ;
	<<m.lcGroupBy>>
where lcFilter is
lcFilter = m.lcFilter + [Trans.cResolution_Codes_fk is Null ] + ;
	[ AND Employee_queue_schedules.tScheduled_time <= ] + ;
	TimeToStr(dtot(m.tdDate+1)-1) + ;
	[ AND Trans_employees_queues.iActive_Flag = 1 ] + ;
	[ AND Employee_queue_schedules.iActive_Flag = 1]
As you see, there is no restrictions on Users table. My tcAddtionalJoin passes a join to a temp cursor containing cUserID list and indexed on cUserID field. My question is:
what would be better in terms of speed: use this kind of join as I presently do or put user's restrictions into where condition, e.g.

and Users.cUserID in (select cUserID from c_temp)

What would you suggest?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform