Solve Merfe Conflict
Optimize query - refs BT#8296
Apply to INNER JOIN to gain performance - refs BT#8296
Solve merge conflict