samba-tool schemaupgrade and provision commands perform set-piece large transactions where we know a large index cache size will speed things up. In join, we use options=['transaction_index_cache_size:200000'] and we can do that in these cases too.
This bug was referenced in samba master: 5092d7f46b8491e4a2d973a00aff4d6c0e77945e e705dbbc6765454813375fee9f6a3365b947e021