Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kf4xY-0002pq-UU for pgsql-admin@arkaria.postgresql.org; Tue, 17 Nov 2020 17:40:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kf4xX-0003FB-Ga for pgsql-admin@arkaria.postgresql.org; Tue, 17 Nov 2020 17:40:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kf4xX-0003F3-85 for pgsql-admin@lists.postgresql.org; Tue, 17 Nov 2020 17:40:03 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kf4xS-00082o-0d for pgsql-admin@lists.postgresql.org; Tue, 17 Nov 2020 17:40:02 +0000 Received: by mail-oi1-x22a.google.com with SMTP id m143so23474124oig.7 for ; Tue, 17 Nov 2020 09:39:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=KKo8N34GM2cy95e6kMA3dOISGqcxV+uiDKkYzvV1nmk=; b=SmcSp5fzxgKJSUOrjstgyt3zPbx/bFaHZX41ixWMfhnLywjJmlWdRUMhPFoqWpE6om cgjAFtfP9+dnnWdHbfWnf4O7JdmTAI9Z2hnfU878iFefItXqpg6kMJpPgzA/RZrUN7ji +C5qjM+rMyut64IZ6BEGLl5ifkp/axAlrq/PHm9c+Wo/CZjrJ33/JqObal0Kblx7lEGE jp1O1xBlH9z4sHkVku/B02FvG+KpcBYSJWhOQ8MgoaQZOhwJoe4z/aFu6fp8rwQ/GCQ0 KWotk56rVlTMMnMXs8DJk46JJCGRErXHGWgrEWBk6Q11UytBcp0oxsqtbOIh/Uah7ow9 x41A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=KKo8N34GM2cy95e6kMA3dOISGqcxV+uiDKkYzvV1nmk=; b=VstPAjbT9PKjjKDt7IxQykmwoSUAvI2/My1znRmEJMTminok/kCz6XKeYAZhYDuwHL HtKNs7cKlfFhp+OvyB66kHFiYuCyRqpR6js7ov331513c1DNnA6CU9TGAbWOYeCe1XF8 WXoxz/Vu1s66x+KMGSgdRNPZnzR/MXZ1YNsQ6lZ4jjIKmyalnTAJgRR6IcpwYFzQjvTH n2MfAO0x/mrWIVtXB70ifYKWyUbAlLBG6foYhaKYSBMgE7AZw3IPt/YASXhg1ctOytfb 81RaBe9uTMspu/nek/vspp1tNt4ECyYa+qmFoyImSuU1zpinrUY7Gix4iG+Pf19F93Ga kZRQ== X-Gm-Message-State: AOAM531SiJ9GW5HjNJjMIf2VqeFlCgJnYVW1pI1YMDApMEfhdz+s942x Lvj/qGswGqxwpGBtwvuMQbTNIhgEJRMFAg== X-Google-Smtp-Source: ABdhPJxV6pe1gmsVCxny80EAzRNEs30oTYT0qxi7DOZGNx+RCgBW7ttfKE+HGIIBVWtGgNWYOY6j2A== X-Received: by 2002:aca:d19:: with SMTP id 25mr162420oin.112.1605634796992; Tue, 17 Nov 2020 09:39:56 -0800 (PST) Received: from [192.168.1.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id s14sm6299637oij.4.2020.11.17.09.39.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Nov 2020 09:39:55 -0800 (PST) Subject: Re: PostgreSQL Tuning and running a query on a big data To: pgsql-admin@lists.postgresql.org References: From: Ron Message-ID: <165cda9c-07f3-0243-5378-5d520a8826f8@gmail.com> Date: Tue, 17 Nov 2020 11:39:55 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------C1D5B78B52DAA515E77D8978" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------C1D5B78B52DAA515E77D8978 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/17/20 11:34 AM, Sachin Kumar wrote: > Hi Experts, > > 1.   I require guidance in tuning my PostgreSQL server installed on > Windows 2016 Server. Please help me out with the configuration. or a url > to ture PostgreSQL Server > > I am not able to find an expert who can help me in Postgres, that why I am > asking too many questions. I will be really grateful if you can help me out. > > > 2.   I have to upload a 5 GB file into a Table. Will it allow a 5GB file > to be uploaded? or I have to increase the tablespace of the particular table. Postgres auto-expands files as needed. > > 3.   while running the query on 1 million cards it is taking too much > time, say 150 min. is there any way I can reduce it. > *Query I am using* > 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" ASC LIMIT 1000 > ) AS v > WHERE m."CARD_SEQUENCE_NUMBER" = v."CARD_SEQUENCE_NUMBER"; Did you put indices on m."CARD_SEQUENCE_NUMBER and SUBSTR(c."ACCOUNT_NUMBER", 1, 10)? -- Angular momentum makes the world go 'round. --------------C1D5B78B52DAA515E77D8978 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 11/17/20 11:34 AM, Sachin Kumar wrote:
Hi Experts,

1.   I require guidance in tuning my PostgreSQL server installed on Windows 2016 Server. Please help me out with the configuration. or a url to ture PostgreSQL Server

I am not able to find an expert who can help me in Postgres, that why I am asking too many questions. I will be really grateful if you can help me out.


2.   I have to upload a 5 GB file into a Table. Will it allow a 5GB file to be uploaded? or I have to increase the tablespace of the particular table.

Postgres auto-expands files as needed.


3.   while running the query on 1 million cards it is taking too much time, say 150 min. is there any way I can reduce it.
Query I am using
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" ASC LIMIT 1000
) AS v
WHERE m."CARD_SEQUENCE_NUMBER" = v."CARD_SEQUENCE_NUMBER";

Did you put indices on m."CARD_SEQUENCE_NUMBER and SUBSTR(c."ACCOUNT_NUMBER", 1, 10)?

--
Angular momentum makes the world go 'round.
--------------C1D5B78B52DAA515E77D8978--