In the end I've modified python code to evade join, and then the optimiser apparently had easier time to sort it out, now it's using the index in both filter and sort.