I am not touching this delicate query, since I would need to run a performance analysis on it and I do not have the time right now (and this bug is pretty urgent).