Reduce unnecessary locking of pruned partitions when reusing cached plans

Reduce unnecessary locking of pruned partitions when reusing cached plans

Edit