Generate all valid indexes for explain to optimize complex queries automatically