Sean_F_Howard
Registered User.
- Local time
- Today, 05:55
- Joined
- Dec 4, 2006
- Messages
- 10
I have a (quite) specific question but I thing it covers something I simply cannot answer.
I have three UPDATE queries running on linked tables in Microsoft Access (2000/XP).
My main data table (the one to be updated) has almost 1million records
My three information tables ALL have primary keys (which are used to link the main table) and vary in size
I have atatched the three UPDATE queries plus descriptions of the field names used.
	
	
	
		
My problem, quite simpley is the speed involved with running these queries. I know that query b) is the quickest with query a) a distant second (I could not even complete the running of query c) and killed it after 6 hours.
What I need to know is WHY is queryC soooo much slower than queryB when the only realy diference that I can see between them if the latter has an extra field to join on
 I have three UPDATE queries running on linked tables in Microsoft Access (2000/XP).
My main data table (the one to be updated) has almost 1million records
My three information tables ALL have primary keys (which are used to link the main table) and vary in size
I have atatched the three UPDATE queries plus descriptions of the field names used.
		Code:
	
	
		Table			Records		Time
[LIST=1]
[*]Main DataTable		900000
[*]Mask nomenk		130		2 hours
[*]Mask media		900		15 minutes
[*]Mask brand		4000		?????
[/LIST]
[B]Query A[/B]
UPDATE [Main DataTable] AS z
INNER JOIN [Mask nomenk] AS n ON (z.nomCode1 = mn.nomCode1) AND (z.nomCode2 = mn.nomCode2) AND (z.nomCode3 = mn.nomCode3) AND (z.nomCode4 = mn.nomCode4) 
SET z.NomenkMask1 = n!NomenkMask1;
[B]Query B[/B]
UPDATE [Main DataTable] AS z
INNER JOIN [Mask media] AS mm ON (z.couCode = mm.couCode) AND (z.nomCode1 = mm.nomCode1) AND (z.pubCode = mm.pubCode) 
SET z.MediaMask1 = mm!MediaMask1;
[B]Query C[/B]
UPDATE [Main DataTable] AS z
INNER JOIN [Mask brand] AS mb ON (z.couCode = mb.couCode) AND (z.nomCode1 = mb.nomCode1) AND (z.brCode1 = mb.brCode1) AND (z.brCode2 = mb.brCode2) 
SET z.BrandMask1 = mb!BrandMask1;
[B][U]Fieldname[/U][/B]	[B][U]FieldType[/U][/B]
couCode	Text
pubCode	Text
nomCode1	Long Integer
nomCode2	Long Integer
nomCode3	Long Integer
nomCode4	Long Integer
brCode1		Long Integer
brCode2		Long IntegerMy problem, quite simpley is the speed involved with running these queries. I know that query b) is the quickest with query a) a distant second (I could not even complete the running of query c) and killed it after 6 hours.
What I need to know is WHY is queryC soooo much slower than queryB when the only realy diference that I can see between them if the latter has an extra field to join on
 
	 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		