Querry correction required - Mailing list pgsql-sql

From Sachin Kumar
Subject Querry correction required
Date
Msg-id CALg-PKCfZOKE1NWnmsartgPvPjypvOb5B+HZ-6q=H0QrFCZmJQ@mail.gmail.com
Whole thread Raw
Responses Re: Querry correction required
List pgsql-sql
Hi Expert,

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";

--

Best Regards,
Sachin Kumar

pgsql-sql by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Identify columns that need indexes
Next
From: Thomas Kellerer
Date:
Subject: Re: Querry correction required