Hello people;
Thank you in advance for taking the time to read my post.
I am executing an export to create a csv file.
For this export, I am using a query containing a NOT IN, which I think is the reason why it has been running for 3 days now... so far, it has checked over 6 million records.
The query uses 3 tables, of which 2 have a common column called 'ssin'.
The 3rd table does not have this column, but I can 'reconstruct' it based upon 3 other columns (nissda, nisscp and nissck). That is why I use the substr and digits commands below.
The query is this one (never mind the substr and so in the first lines):
SELECT * from prodadm.nficts NFICTS where
DECIMAL(SUBSTR(DIGITS(nficts.nissda),5,2) ||SUBSTR(DIGITS(nficts.nissda),3,2) ||SUBSTR(DIGITS(nficts.nissda),1,2)||SUBSTR(DIGITS (nficts.nisscp),1,3)||SUBSTR(DIGITS(nficts.nissck) ,1,2),11,0)
in (SELECT ssin from register.person_identifier where person_status_code=3 and replaced_by is null and ssin
not in (SELECT ssin from register.phoneme))
Does anyone have any idea how I could speed up things?

I do not have that much experience. I thought about using a join, but how does one replace a 'NOT IN' by a join?
Many thanks in advance for any input!
Carl