Arnt Gulbrandsen wrote: >The point of the locking was to block a race: > delete from x where y in (select y from x)
>The select runs first, then the delete, and if there's an insert >between the two, the delete may fail. My patch preserves that behaviour. The changes are: - Adding a limit 1000 to that inner select, to chop things up in workable blocks which take 30 seconds per block on average. - Perform every delete in a transaction by itself, instead of all deletes on all tables in a single huge transaction. Using this patched version of aox vacuum on my system it's basically the first time (ever) that the vacuum ran in full without blocking things for the users; with the added benefit that if the aox vacuum is canceled at any point in time, the database will not stay busy for more than a minute, and all deletions performed till then are not lost. -- Stephen.
