While running the below mention query on 2 million cards it is taking too much time, say 420 min. is there any way I can reduce the timing..
Please find my query.
UPDATE hk_card_master_test m SET "ACCOUNT_NUMBER" = v."v_account_number", "ISSUANCE_NUMBER" = v."v_issuance_number","cron"=1 FROM ( SELECT h."id",h."CARD_SEQUENCE_NUMBER" ,h."ACCOUNT_NUMBER" ,h."ISSUANCE_NUMBER",c."ACCOUNT_NUMBER" v_account_number,c."ISSUANCE_NUMBER" v_issuance_number FROM hk_card_master_test h JOIN vdaccount_card_bank c ON SUBSTR(c."ACCOUNT_NUMBER", 1, 10) = h."CARD_SEQUENCE_NUMBER" ORDER BY h."id" ) AS v WHERE m."CARD_SEQUENCE_NUMBER" = v."CARD_SEQUENCE_NUMBER";