From: | Sachin Kumar <sachinkumaras(at)gmail(dot)com> |
---|---|
To: | pgsql-sql(at)lists(dot)postgresql(dot)org |
Subject: | Querry correction required |
Date: | 2020-11-18 17:43:12 |
Message-ID: | CALg-PKCfZOKE1NWnmsartgPvPjypvOb5B+HZ-6q=H0QrFCZmJQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Kellerer | 2020-11-18 17:49:23 | Re: Querry correction required |
Previous Message | hubert depesz lubaczewski | 2020-11-12 11:14:08 | Re: Identify columns that need indexes |