Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rs7td-004yza-16 for pgsql-general@arkaria.postgresql.org; Wed, 03 Apr 2024 21:11:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rs7ta-008k0T-NK for pgsql-general@arkaria.postgresql.org; Wed, 03 Apr 2024 21:11:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rs7tY-008k0K-PA for pgsql-general@lists.postgresql.org; Wed, 03 Apr 2024 21:11:46 +0000 Received: from fhigh1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rs7tU-000Q6R-Sj for pgsql-general@lists.postgresql.org; Wed, 03 Apr 2024 21:11:43 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 78BAC1140098; Wed, 3 Apr 2024 17:11:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2024 17:11:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1712178699; x=1712265099; bh=qZVdaVAjqtFXyHTMbu7S9uSctsHyGzwFKdRU0vF6Lh4=; b= fnzovV+HnHAf1skJKLEwbaEUJ53ecSMAkt3giDmZAAIUoijNtkB+lcJPE8Dg2XpQ pMNenEtrLVF5va9gAPOZoqc+hfY4PFdL0gh56f8xe7LVPPDBGgv82IXEB24IrCWL MUYcG//v1OBwKCBujuWf+w8gD/NwccdgbOKGzptCJ66JvMuzrxoSVgNKe1wZhfhD GOSsspVu7Tg3XA0XL8lV/F/IBGMR9DZZQAoQEVtJQwSg+u2qf4KPprdLMBR6+wNV qa4NOSQTsLzY82FKsn2bucmh33zjUkkzx7CrTpuIE13FAQ3hRrSPDFyGqK3EGiYl RSJCJbIqny93q6fXQd1lxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712178699; x= 1712265099; bh=qZVdaVAjqtFXyHTMbu7S9uSctsHyGzwFKdRU0vF6Lh4=; b=Y dr05WAGP4Ge5UOwq1rOMJZUG51tHuytlU1M5F34M0Uf+w/OqCvmoDm0p10xThxRT SwGc+On0/djiXTGUW9ZTUDVu4mN8WORjacC388dnSHxDmYpx/yT/ZREddpmcxyo0 J8xcPBazGtjfUavbuc873Re5HRC15jN8rNx5dKgRBqwEKZLnlrs6Yx0lUMlrEzs0 VlJqBTvXvq61pvMz+XHC6/JoMPCwtAxWMjj8ntJUZE6ViAB3ojYtZvxamZWCubSc LjX0sabVBG4ZhakHhmcvQOO7BfD8Uae1lvfXZ4JOxk4s/1qaOPtNyBm0EMlocRD+ K//BfXCd9YoELdURmGtWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefiedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesth ekredttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeelgeevke ekkeeuiefgtdevieeluefhfedufeetkeejffekjeeujeehgeehgeektdenucffohhmrghi nhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdr tghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 17:11:38 -0400 (EDT) Message-ID: Date: Wed, 3 Apr 2024 14:11:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Moving delta data faster To: yudhi s , pgsql-general References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/3/24 13:38, yudhi s wrote: >  Hi All, >  It's postgresql database version 15.4. We have a requirement in which > we will be initially moving full table data for 3-4 tables, from source > database to target(i.e. postgres) . Maximum number of rows will be > ~10million rows in those tables. Then subsequently these rows will be > inserted/updated based on the delta number of rows that got > inserted/updated in the source database. In some cases these changed > data can flow multiple times per day to the downstream i.e. postgres > database and in other cases once daily. What is the source database? Can it be reached with a FDW?: https://wiki.postgresql.org/wiki/Foreign_data_wrappers Can the delta on the source be output as CSV? > >  Want to understand , if we should use upsert(insert on conflict) or > merge statements or anything else in such a scenario so as to persist > those delta records faster in the target database, while making the > system online to the users? > > Regards > Yudhi -- Adrian Klaver adrian.klaver@aklaver.com