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 1oEBf0-0001EY-7z for pgsql-general@arkaria.postgresql.org; Wed, 20 Jul 2022 15:30:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEBey-0005mP-RS for pgsql-general@arkaria.postgresql.org; Wed, 20 Jul 2022 15:30:48 +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 1oEBey-0005mG-H8 for pgsql-general@lists.postgresql.org; Wed, 20 Jul 2022 15:30:48 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oEBew-0007EH-0S for pgsql-general@lists.postgresql.org; Wed, 20 Jul 2022 15:30:47 +0000 Received: by mail-pj1-x1033.google.com with SMTP id p6-20020a17090a680600b001f2267a1c84so720908pjj.5 for ; Wed, 20 Jul 2022 08:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=gWSOuAQ1qodBNwk6oBGJYDKx7HjNNUxhxaZ5XDsvOfs=; b=TVhbAi/SnaW2vv5ln8MIPFVM2PAdICHq/MF7bV99WRPJw4OdXrSJ+WvCI68ky/fnMh Jgm7wSSv9Z6BtxFofwhwc5ycx0I3M47p7c3IRCLPpa539cXy1/sk8VGaZ4kqpyvhTpOG Ivw26yC3a/84lSGxPpilGT86jOuSJu0GHN1CmZXmKCk/NuG9GZFyWlBYGesYOXOsz4qj i3q1a11+lJiz7tGydoFlWamapGgNy2UAgmbCl6Z0/q5pgnggeOxzu65xxtE1qAPerOkR S/njn4Zm2kVreY2iTXv5Bxvav9bHOnIssT8SC1NP24S85ukA6wsJKvocOYaEjr9xetFC 39uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=gWSOuAQ1qodBNwk6oBGJYDKx7HjNNUxhxaZ5XDsvOfs=; b=b1u/TEEq4/bYc8mMDtyomzTAbMINpguFXTxHhh615OBY7kvd0UlySC67KSUxuWeQZ1 8wEi04anuB9F3yslHilHMn/kIxOo77EmmyxBMWkz921ecWofqcIGoIDhjPmdTyelQXIo FP6lBWwST3q9NVryVY8F//BXNDTvKPtFUiophbLuhujp0terFazmS8MxFSRYouzMLSnG GNzN8qREEkhPIWfIiIe5M2NNyOHbxAJ3hZXzDRqILAes6ECXou9RJF96243rh5GHudNy TZH8wctWfUF7Db2BCNWjwbddd7UOpoLN1KBlzsbZZIbAez/rQDZbHKI5Qlkl9i8JfYQE clqw== X-Gm-Message-State: AJIora+iRv+MvROC2GoweAySRcN/q7Xf1RUKWS2eXWPkrh7CiT0EukGf xRTp9GQu+xG8IZYSARgJm9EzsvNAB9w= X-Google-Smtp-Source: AGRyM1teXIhwQFEyA6WzNoo1R2m0QpMt+gJcgmxq+TMTeBGM6UpTUW5KqEO5aNHXJFSvbJuE6/f+1g== X-Received: by 2002:a17:903:18c:b0:16c:51c6:675d with SMTP id z12-20020a170903018c00b0016c51c6675dmr38895594plg.153.1658331044341; Wed, 20 Jul 2022 08:30:44 -0700 (PDT) Received: from [10.128.56.157] ([155.98.131.5]) by smtp.gmail.com with ESMTPSA id h27-20020aa79f5b000000b00528c16966casm14088847pfr.174.2022.07.20.08.30.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Jul 2022 08:30:43 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------0yV3A2IXhIny5A1vVtf5kLEl" Message-ID: Date: Wed, 20 Jul 2022 09:30:42 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Batch process Content-Language: en-CA To: pgsql-general@lists.postgresql.org References: <375897a0-fbbb-8712-8164-8fbd3cab074a@aklaver.com> From: Rob Sargent In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------0yV3A2IXhIny5A1vVtf5kLEl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/20/22 09:26, Rama Krishnan wrote: > Hi Adrian, > > Thanks for the update. > > > Is it possible to achieve 10000 records deletion on every iteration > because my original table contains 5M records during the deletion > process it consumes more cpu and resources. See here for date manipulation functions.  you can delete by month or week, which ever makes it fit your hardware --------------0yV3A2IXhIny5A1vVtf5kLEl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 7/20/22 09:26, Rama Krishnan wrote:
Hi Adrian, 

Thanks for the update. 


Is it possible to achieve 10000 records deletion on every iteration because my original table contains 5M records during the deletion process it consumes more cpu and resources.


See here for date manipulation functions.  you can delete by month or week, which ever makes it fit your hardware

--------------0yV3A2IXhIny5A1vVtf5kLEl--