Re: Runscript Unknown term code Re: Bacula 15.0.2 update

Phil Stracchino <[email protected]> Mon, 13 May 2024 15:25:51 -0400
Newsgroups gmane.comp.sysutils.backup.bacula.devel
Organization Fenian House Publishing
Message-ID <[email protected]>
Differential backup completed, bvfs-update is running now ...

The DELETE FROM PathVisibility query is VERY, VERY slow, but bulk 
deletes in MySQL have always been slow.

There is a technique that optimizes bulk delete speeds, but it adds 
significant complexity.  It goes basically like this:


CREATE TEMPORARY TABLE T (id INT UNSIGNED PRIMARY KEY);

INSERT INTO T
SELECT <row IDs you want to delete> FROM <target table>;

REPEAT
    DELETE target FROM target
    JOIN T on target.id = T.id
    ORDER BY t.id DESC
    LIMIT 10000;
    UNTIL ROW_COUNT() < 10000
END REPEAT;

DROP TEMPORARY TABLE T;


-- 
   Phil Stracchino
   Fenian House Publishing
   [email protected]
   [email protected]
   Landline: +1.603.293.8485
   Mobile:   +1.603.998.6958