So, the thing is I am having a moderately large list of emails ~ 250,000 entries.
I have another table containing list of invalid emails ~ 50,000 which i need to remove (mark inactive) from 1st table. For that I have ran a simple django function which is taking 3-4 seconds in each loop. The code is:
def clean_list():
id = 9
while id<40000:
i = Invalid.objects.get(id=id)
y = i.email.strip()
f = IndiList.objects.get(email__contains=y)
f.active = False
f.save()
id +=1
What would be a better way to do it? Either a SQL query or a better piece of django code or some other way.
Help!