I have two tables which are in two different servers. both tables are huge they have more than 100k records. what im trying to get all the account numbers that are not in bitdisclosure table but in member table where member_flags=1 The problem is that is really slow how can i make it faster?
<cfquery datasource="#v_DATASOURCE_2#" name="GetMember" result="tmpResult2">
SELECT [Account] FROM [BITDisclosure]
</cfquery>
<cfquery datasource="#v_DATASOURCE#" name="GetPositiveCOSAccounts" result="tmpResult">
SELECT member_account ,member_flags
FROM [member] where member_flags=1 and member_account not IN (#ValueList(GetMember.account)#)
</cfquery>
When i try it with top 1000 record it gives results fast, is there another way i can speed up the process?