Re: [GENERAL] Fast way to delete big table?

2016-05-16 Thread hmzha2
Hi Charles, Thanks. The reason I dont have condition when selecting is it's faster than having. Because my aim is to go through every row, find values of few columns and append them to a summary table. Then delete the row from the table. So find the rows on the fly is fine for me. I have tried t

Re: [GENERAL] Fast way to delete big table?

2016-05-16 Thread hmzha2
Hi Jeff,Thank you very much.>Your examples also have no selection criteria or stopping criteria (other>than when your outer driving script stops calling the function). That>means you might be deleting any arbitrary rows in the master table (not>just the oldest ones) and might proceed with these de

Re: [GENERAL] Fast way to delete big table?

2016-05-16 Thread hmzha2
Charles Clavadetscher wrote > Hello > > This is quite weird... It there any other process locking the record or > the table? > Bye > Charles Yes, weird. The table is using by other process (keep inserting rows to the table) at the same time but no one should lock the row as we dont touch rows aft

Re: [GENERAL] Fast way to delete big table?

2016-05-17 Thread hmzha2
Hi Jeff and all, Thank you for your help. Just update my progress, I finally made it working in production by using the second solution. The extra thing I have done was "restart postgres" and the script started to delete 2558 records per second. I guess it must has locked records or something blo