james wrote: >On 23/02/2014 11:08, Stephen R. van den Berg wrote: >>Collecting all ids to be deleted in one temp table is not a good idea >>to begin with. Collecting the ids could become a scaling problem.
>I disagree. Temp tables are lightweight and ids are small; workmem >could easily be more of a problem. And if its really a concern that >so much has become garbage (in which case a big transaction is also a >big problem) then just enforce an upper limit in the select with a >max count. I'd wager that you'd probably set that count pretty high. Setting that max count is essential. Omitting that is a recipe for disaster on larger scales. With respect to "pretty high", it depends on what you consider "pretty high". In my case the optimum is close to 1000, which does not qualify as "pretty high", I think. It results in work-runs per delete of on average 30 seconds, and a minimum of 15 seconds, and a rough maximum of 4 minutes. -- Stephen.
