Re: Batch process

2022-07-20 Thread Adrian Klaver
On 7/20/22 11:56, Ron wrote: How will DELETE WHERE sales_id IN (...); , given that test_old has no index? Of course, we don't know if there's an index on sales.bill_date, since OP's only response has been another "tell me how to do it". This awaits more information. At this point it is abo

Re: Batch process

2022-07-20 Thread Ron
How will DELETE WHERE sales_id IN (...); , given that test_old has no index? Of course, we don't know if there's an index on sales.bill_date, since OP's only response has been another "tell me how to do it". On 7/20/22 13:32, Adrian Klaver wrote: On 7/20/22 11:16 AM, Ron wrote: But the first

Re: Batch process

2022-07-20 Thread Adrian Klaver
On 7/20/22 11:16 AM, Ron wrote: But the first thing he does is drop test_old. Then: Create table test_old as select * from sales where bill_date-interval '1 year'; At that point you could do either: Delete from sales where sales_id in (select sales_id from test_old); or DELETE FROM sales

Re: Batch process

2022-07-20 Thread Ron
But the first thing he does is drop test_old. On 7/20/22 09:52, Adrian Klaver wrote: On 7/20/22 01:28, Ron wrote: On 7/20/22 00:08, Rama Krishnan wrote: Hi All, I am doing purge activity my sales table contains 5M records I am going to delete more than 1 year data (which was 3M) records so i

Re: Batch process

2022-07-20 Thread Adrian Klaver
On 7/20/22 9:38 AM, Rama Krishnan wrote: Reply to list also Ccing list. Hi ALL, I have created the batch wise query but the variable is not working in the delete. create or replace function sports_sale() returns void as $$ declare    counter integer := 0;    row_count integer :=0;    sta

Re: Batch process

2022-07-20 Thread Rob Sargent
On 7/20/22 09:26, Rama Krishnan wrote: Hi Adrian, Thanks for the update. Is it possible to achieve 1 records deletion on every iteration because my original table contains 5M records during the deletion process it consumes more cpu and resources. See here

Re: Batch process

2022-07-20 Thread Rama Krishnan
Hi Adrian, Thanks for the update. Is it possible to achieve 1 records deletion on every iteration because my original table contains 5M records during the deletion process it consumes more cpu and resources. On Wed, 20 Jul, 2022, 20:37 Adrian Klaver, wrote: > On 7/19/22 22:08, Rama Krishn

Re: Batch process

2022-07-20 Thread Adrian Klaver
On 7/19/22 22:08, Rama Krishnan wrote: Hi All, I am doing purge activity my sales table contains 5M records I am going to delete more than 1 year data (which was 3M) records so it was running more so I want to do batch wise deletion through plsql  created or replace function data_purge()

Re: Batch process

2022-07-20 Thread Adrian Klaver
On 7/20/22 01:28, Ron wrote: On 7/20/22 00:08, Rama Krishnan wrote: Hi All, I am doing purge activity my sales table contains 5M records I am going to delete more than 1 year data (which was 3M) records so it was running more so I want to do batch wise deletion through plsql  created or

Re: Batch process

2022-07-20 Thread Ron
On 7/20/22 00:08, Rama Krishnan wrote: Hi All, I am doing purge activity my sales table contains 5M records I am going to delete more than 1 year data (which was 3M) records so it was running more so I want to do batch wise deletion through plsql  created or replace function data_purge()

Batch process

2022-07-19 Thread Rama Krishnan
Hi All, I am doing purge activity my sales table contains 5M records I am going to delete more than 1 year data (which was 3M) records so it was running more so I want to do batch wise deletion through plsql created or replace function data_purge() returns void as$$ Declare Begin Drop table t