On 1/15/21 1:37 PM, Martin Simmons wrote:
>>>>>> On Fri, 15 Jan 2021 12:19:29 -0500, Phil Stracchino said:
>>
>> This both filters already-existing Paths out of the batch set much more
>> efficiently, AND does not fail if another job inserts those same Paths
>> first.  If you compare the execution plans for the two queries you will
>> see that the second performs ENORMOUSLY better.
> 
> Batch mode locks the tables, so it is impossible for another job to insert at
> the same time.


OK, though that triple SELECT is still extremely inefficient.  That
probably does make the INSERT IGNORE there moot though.

That said, explicit table locks are usually a bad idea and should be
avoided where possible.



-- 
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958


_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to